Fix scoring bug, and tests #498
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: CI Workflow | |
permissions: | |
contents: write | |
id-token: write | |
packages: read | |
pull-requests: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
jobs: | |
qa: | |
name: Code quality checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install tox | |
run: pip install tox | |
- name: Run quality checks | |
run: tox -e py310-lint,py310-type | |
- name: Directory Cache | |
uses: actions/cache@v4 | |
with: | |
path: .tox | |
key: tox-${{ runner.os }}-3.10-${{ hashFiles('tox.ini') }} | |
restore-keys: | | |
tox-${{ runner.os }}-3.10- | |
test: | |
name: Build and test docker image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Configure docker | |
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | |
- name: Get changed source files | |
id: changed-src | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: src/** | |
- name: Get changed base image files | |
if: steps.changed-src.outputs.any_changed == 'true' | |
id: changed-base | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: dockerfiles/base/* | |
- name: Pull base image and build | |
if: steps.changed-src.outputs.any_changed == 'true' && steps.changed-base.outputs.any_changed == 'true' | |
run: python flows/docker.py pull --build | |
- name: Pull base image | |
if: steps.changed-src.outputs.any_changed == 'true' && steps.changed-base.outputs.any_changed != 'true' | |
run: python flows/docker.py pull | |
- name: Build image | |
if: steps.changed-src.outputs.any_changed == 'true' | |
run: python flows/docker.py build | |
- name: Run test image | |
if: steps.changed-src.outputs.any_changed == 'true' | |
run: python flows/docker.py test | |
- name: Copy and surgery coverage | |
if: steps.changed-src.outputs.any_changed == 'true' | |
run: | | |
cp reports/.coverage . | |
sqlite3 .coverage "update file set path='src/' || substr(path, 40);" | |
- name: Post coverage comment | |
if: steps.changed-src.outputs.any_changed == 'true' | |
uses: py-cov-action/python-coverage-comment-action@v3 | |
with: | |
GITHUB_TOKEN: ${{ github.token }} | |
docs: | |
name: Test documentation build | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment.yml | |
create-args: python=3.10 | |
init-shell: bash | |
cache-downloads: true | |
cache-environment: true | |
post-cleanup: all | |
- name: Install Python requirements | |
run: pip install six ".[docs,loader]" | |
- name: Build the documentation | |
run: sphinx-build --fail-on-warning docs build/docs |