ci(test): add workflow call trigger #590
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: tests | |
on: [push, workflow_call] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
# https://github.com/actions/checkout | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# https://github.com/actions/setup-python | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# https://github.com/snok/install-poetry | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install Dependencies | |
run: poetry install | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Code Quality | |
run: poetry run black . --check | |
- name: Test with pytest | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_GITHUB_TOKEN }} | |
GITLAB_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }} | |
run: make test | |
- name: Upload coverage report | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.ACCESS_GITHUB_TOKEN }} | |
GITLAB_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }} | |
COVERALLS_PARALLEL: true | |
run: | | |
pip install coveralls | |
coveralls --service=github-actions | |
continue-on-error: true | |
finish: | |
needs: test | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/coverallsapp/github-action | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
parallel-finished: true |