Skip to content

CI

CI #23

Workflow file for this run

name: "CI"
on:
- push
- pull_request
jobs:
test-example-problem:
name: "Test Example Problem"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Install Application with pip"
run: pip install .
- name: "Run Problem Tester"
run: |
python -m algobowl.lib.problem_tester example_problems/number_in_range
migration-test:
name: "Migration Test"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Install Application with pip"
run: pip install .[dev]
- name: "Setup App"
run: gearbox setup-app -c development.ini.sample
- name: "Run Migration Test"
run: ./migration_test.sh
curl-test:
name: "Smoke Test App with cURL"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Install Application with pip"
run: pip install .[dev]
- name: "Setup App"
run: gearbox setup-app -c development.ini.sample
- name: "Run cURL test"
run: |
gearbox serve -c development.ini.sample --daemon
sleep 2
gearbox serve --status
sleep 2
curl -f http://127.0.0.1:8080/
curl -f http://127.0.0.1:8080/competition
curl -f http://127.0.0.1:8080/competition/archive
gearbox serve -c development.ini.sample --stop-daemon
black-check:
name: "Check source is formatted with Black"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Install black"
run: pip install black
- name: "Check source code is formatted with Black"
run: black --check --diff .
isort-check:
name: "Check source is formatted with isort"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Install isort"
run: pip install isort
- name: "Check source code is formatted with isort"
run: isort --check .
build-dist:
name: "Build Wheel"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Install build dependencies"
run: pip install --upgrade build wheel setuptools
- name: "Build"
run: python -m build
- name: "Upload Artifacts"
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
pypi-publish:
name: Upload release to PyPI
needs: build-dist
runs-on: ubuntu-22.04
environment:
name: release
url: https://pypi.org/p/algobowl
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- name: "Download Artifacts"
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1