feat: circleci -> actions #7
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 | |
on: pull_request | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "poetry" | |
- name: Run Code Linting | |
run: make -k lint | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "poetry" | |
- name: Create Workspace | |
run: mkdir -p workspace | |
- name: Run unit tests | |
run: make unit-tests | |
env: | |
TEST_RESULTS_DIR: workspace/test-results | |
- name: Generate Test Coverage | |
run: make coverage-unit | |
- uses: actions/upload-artifact@v4 | |
name: unit-test-results | |
with: | |
path: | | |
workspace/test-results | |
integration-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "poetry" | |
- name: Create Workspace | |
run: mkdir -p workspace | |
- name: Run Integration Tests | |
run: make integration-tests | |
env: | |
TEST_RESULTS_DIR: workspace/test-results | |
- name: Generate Test Coverage | |
run: make coverage-integration | |
- uses: actions/upload-artifact@v4 | |
name: integration-test-results | |
with: | |
path: | | |
workspace/test-results | |
test-coverage-checks: | |
needs: [unit-tests, integration-tests] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "poetry" | |
- name: Create Workspace | |
run: mkdir -p workspace | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: workspace | |
merge-multiple: true | |
- name: Evaluate Minimum Test Coverage | |
run: make test-coverage-check | |
env: | |
TEST_RESULTS_DIR: workspace/test-results | |
- name: Generate Coverage | |
run: make coverage-combined | |
- uses: actions/upload-artifact@v4 | |
name: overall-test-coverage | |
with: | |
path: | | |
workspace/test-results/coverage.json |