Style updates and improved matrix include
This commit is contained in:
parent
a5fc4dad35
commit
37ac4d55a4
2 changed files with 20 additions and 19 deletions
18
.github/actions/setup-database.yml
vendored
18
.github/actions/setup-database.yml
vendored
|
|
@ -4,9 +4,9 @@
|
||||||
# (such as with PostgreSQL and MySQL) before you initiate unit tests that will employ that
|
# (such as with PostgreSQL and MySQL) before you initiate unit tests that will employ that
|
||||||
# database service.
|
# database service.
|
||||||
|
|
||||||
# NOTE: This action was written for use with the core Evennia workflows ONLY.
|
# NOTE: This action was intended for use with the core Evennia workflows ONLY.
|
||||||
|
|
||||||
name: Set up Database
|
name: Set up Evennia database service
|
||||||
author: dvoraen
|
author: dvoraen
|
||||||
description: "Activates the database server for the passed in service and ensures it's ready for use."
|
description: "Activates the database server for the passed in service and ensures it's ready for use."
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ runs:
|
||||||
# if: inputs.database == "sqlite3"
|
# if: inputs.database == "sqlite3"
|
||||||
|
|
||||||
- name: Set up PostgreSQL server
|
- name: Set up PostgreSQL server
|
||||||
if: inputs.database == "postgresql"
|
if: ${{ inputs.database == "postgresql" }}
|
||||||
uses: harmon758/postgresql-action@v1
|
uses: harmon758/postgresql-action@v1
|
||||||
with:
|
with:
|
||||||
postgresql version: "11"
|
postgresql version: "11"
|
||||||
|
|
@ -33,7 +33,7 @@ runs:
|
||||||
postgresql password: "password"
|
postgresql password: "password"
|
||||||
|
|
||||||
- name: Wait for PostgreSQL to activate
|
- name: Wait for PostgreSQL to activate
|
||||||
if: inputs.database == "postgresql" && success()
|
if: ${{ inputs.database == "postgresql" }}
|
||||||
run: |
|
run: |
|
||||||
while ! pg_isready -h 127.0.0.1 -q >/dev/null 2>&1
|
while ! pg_isready -h 127.0.0.1 -q >/dev/null 2>&1
|
||||||
do
|
do
|
||||||
|
|
@ -44,7 +44,7 @@ runs:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Set up MySQL server
|
- name: Set up MySQL server
|
||||||
if: inputs.database == "mysql"
|
if: ${{ inputs.database == "mysql" }}
|
||||||
uses: mirromutth/mysql-action@v1.1
|
uses: mirromutth/mysql-action@v1.1
|
||||||
with:
|
with:
|
||||||
host port: 3306
|
host port: 3306
|
||||||
|
|
@ -58,7 +58,7 @@ runs:
|
||||||
mysql root password: root_password
|
mysql root password: root_password
|
||||||
|
|
||||||
- name: Wait for MySQL to activate
|
- name: Wait for MySQL to activate
|
||||||
if: inputs.database == "mysql" && success()
|
if: ${{ inputs.database == "mysql" }}
|
||||||
run: |
|
run: |
|
||||||
while ! mysqladmin ping -h 127.0.0.1 -u root -proot_password -s >/dev/null 2>&1
|
while ! mysqladmin ping -h 127.0.0.1 -u root -proot_password -s >/dev/null 2>&1
|
||||||
do
|
do
|
||||||
|
|
@ -69,7 +69,7 @@ runs:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Set up MySQL Privileges
|
- name: Set up MySQL Privileges
|
||||||
if: inputs.database == "mysql" && success()
|
if: ${{ inputs.database == "mysql" }}
|
||||||
run: |
|
run: |
|
||||||
cat <<EOF | mysql -u root -proot_password -h 127.0.0.1 mysql
|
cat <<EOF | mysql -u root -proot_password -h 127.0.0.1 mysql
|
||||||
create user 'evennia'@'%' identified by 'password';
|
create user 'evennia'@'%' identified by 'password';
|
||||||
|
|
@ -81,9 +81,9 @@ runs:
|
||||||
|
|
||||||
# get logs from db start
|
# get logs from db start
|
||||||
- name: Database container logs
|
- name: Database container logs
|
||||||
if: (inputs.database == 'postgresql' || inputs.database == 'mysql') && success()
|
if: ${{ inputs.database == 'postgresql' || inputs.database == 'mysql' }}
|
||||||
uses: jwalton/gh-docker-logs@v2
|
uses: jwalton/gh-docker-logs@v2
|
||||||
|
|
||||||
- name: Check running containers
|
- name: Check running containers
|
||||||
if: (inputs.database == 'postgresql' || inputs.database == 'mysql') && success()
|
if: ${{ inputs.database == 'postgresql' || inputs.database == 'mysql' }}
|
||||||
run: docker ps -a
|
run: docker ps -a
|
||||||
|
|
|
||||||
21
.github/workflows/github_action_test_suite.yml
vendored
21
.github/workflows/github_action_test_suite.yml
vendored
|
|
@ -22,10 +22,9 @@ jobs:
|
||||||
python-version: ["3.9", "3.10", "3.11"]
|
python-version: ["3.9", "3.10", "3.11"]
|
||||||
TESTING_DB: ["sqlite3", "postgresql", "mysql"]
|
TESTING_DB: ["sqlite3", "postgresql", "mysql"]
|
||||||
include:
|
include:
|
||||||
- coverage-test: false
|
- python-version: "3.10"
|
||||||
- coverage-test: true
|
|
||||||
python-version: "3.10"
|
|
||||||
TESTING_DB: "sqlite3"
|
TESTING_DB: "sqlite3"
|
||||||
|
coverage-test: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
@ -66,7 +65,7 @@ jobs:
|
||||||
# OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage
|
# OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage
|
||||||
# calculation!
|
# calculation!
|
||||||
- name: Run test suite with coverage
|
- name: Run test suite with coverage
|
||||||
if: matrix.coverage-test
|
if: ${{ matrix.coverage-test }}
|
||||||
working-directory: testing_mygame
|
working-directory: testing_mygame
|
||||||
run: |
|
run: |
|
||||||
coverage run \
|
coverage run \
|
||||||
|
|
@ -82,7 +81,7 @@ jobs:
|
||||||
|
|
||||||
# For other runs, run tests in parallel
|
# For other runs, run tests in parallel
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
if: ! matrix.coverage-test
|
if: ! ${{ matrix.coverage-test }}
|
||||||
working-directory: testing_mygame
|
working-directory: testing_mygame
|
||||||
run: |
|
run: |
|
||||||
evennia test \
|
evennia test \
|
||||||
|
|
@ -92,11 +91,11 @@ jobs:
|
||||||
--timing \
|
--timing \
|
||||||
evennia
|
evennia
|
||||||
|
|
||||||
# we only want to run coverall once, so we only do it for one of the matrix combinations
|
# we only want to run coverall once, so we only do it for the designated matrix combination(s)
|
||||||
# it's also not critical if pushing to either service fails (happens for PRs since env is not
|
# it's also not critical if pushing to either service fails (happens for PRs since env is not
|
||||||
# available outside of the evennia org)
|
# available outside of the evennia org)
|
||||||
- name: Send data to Coveralls
|
- name: Send data to Coveralls
|
||||||
if: matrix.coverage-test && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
|
if: ${{ matrix.coverage-test && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||||
|
|
@ -109,6 +108,8 @@ jobs:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
|
@ -116,14 +117,14 @@ jobs:
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
|
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' }}
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push for master
|
- name: Build and push for master
|
||||||
if: github.ref == 'refs/heads/master'
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
id: docker_build_master
|
id: docker_build_master
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -131,7 +132,7 @@ jobs:
|
||||||
tags: evennia/evennia:latest
|
tags: evennia/evennia:latest
|
||||||
|
|
||||||
- name: Build and push for develop
|
- name: Build and push for develop
|
||||||
if: github.ref == 'refs/heads/develop'
|
if: ${{ github.ref == 'refs/heads/develop' }}
|
||||||
id: docker_build_develop
|
id: docker_build_develop
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue