Extra parentheses #1103
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Gamedata | |
on: | |
push: | |
pull_request: | |
repository_dispatch: | |
types: [ ci-approve-command ] | |
env: | |
# push/1st party PR uses the GH context ref, repo_dispatch (3pp PR) uses the ref in the payload | |
REF_UNDER_TEST: ${{ github.event_name != 'repository_dispatch' && github.ref || format('refs/pull/{0}/merge', github.event.client_payload.pull_request.number) }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
# only run on push, dispatch, or 1st party PR | |
if: | |
github.event_name != 'pull_request' || | |
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) | |
services: | |
redis: # redis://redis:6379/0 | |
image: redis | |
ports: | |
- 6379:6379 | |
mongo: # mongodb://root:topsecret@mongo:27017 | |
image: mongo | |
ports: | |
- 27017:27017 | |
env: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: topsecret | |
env: | |
NO_DICECLOUD: 1 | |
DISCORD_OWNER_USER_ID: "98765432109876543" | |
MONGO_URL: mongodb://root:topsecret@localhost:27017 | |
REDIS_URL: redis://localhost:6379/0 | |
steps: | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Checkout Avrae | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.REF_UNDER_TEST }} | |
- name: Checkout Gamedata repo | |
uses: actions/checkout@v3 | |
with: | |
path: avrae-data | |
repository: avrae/avrae-data | |
token: ${{ secrets.ORG_REPO_ACCESS_TOKEN }} | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', 'avrae/tests/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install -r tests/requirements.txt | |
mkdir shared | |
- name: Run Tests | |
run: pytest --tb=short --disable-warnings -rfE --cov=cogs5e --cov=cogsmisc --cov=utils --cov-report=xml:shared/coverage.xml -m gamedata tests/ | |
env: | |
TEST_GAMEDATA_BASE_PATH: "avrae-data/dist" | |
TEST_SIMULATION_BASE_PATH: "avrae-data/dist" | |
- name: Upload Coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
files: ./shared/coverage.xml | |
- name: Create Comment (3pp PRs) | |
if: github.event_name == 'repository_dispatch' && always() | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | |
issue-number: ${{ github.event.client_payload.github.payload.issue.number }} | |
body: | | |
The gamedata test workflow concluded with **${{ job.status }}**. | |
[Command run output][1] | |
[1]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |