2022-10-24 21:51:15 +00:00
|
|
|
name: test
|
|
|
|
|
2022-12-04 00:42:59 +00:00
|
|
|
on:
|
2023-07-21 16:20:24 +00:00
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
working-directory:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
description: "From which folder this pipeline executes"
|
2022-12-04 00:42:59 +00:00
|
|
|
|
|
|
|
env:
|
2023-10-03 23:23:54 +00:00
|
|
|
POETRY_VERSION: "1.6.1"
|
2022-10-24 21:51:15 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-07-21 16:20:24 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: ${{ inputs.working-directory }}
|
2022-10-24 21:51:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-12-04 00:42:59 +00:00
|
|
|
python-version:
|
2022-12-13 13:48:53 +00:00
|
|
|
- "3.8"
|
|
|
|
- "3.9"
|
|
|
|
- "3.10"
|
|
|
|
- "3.11"
|
2023-08-22 15:36:52 +00:00
|
|
|
name: Python ${{ matrix.python-version }}
|
2022-10-24 21:51:15 +00:00
|
|
|
steps:
|
2023-10-23 14:01:33 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-22 19:59:22 +00:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
2023-05-10 13:35:07 +00:00
|
|
|
uses: "./.github/actions/poetry_setup"
|
2022-12-13 13:48:53 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2023-08-21 14:35:56 +00:00
|
|
|
poetry-version: ${{ env.POETRY_VERSION }}
|
2023-08-22 19:59:22 +00:00
|
|
|
working-directory: ${{ inputs.working-directory }}
|
2023-08-22 15:36:52 +00:00
|
|
|
cache-key: core
|
2023-08-22 19:59:22 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
shell: bash
|
|
|
|
run: poetry install
|
|
|
|
|
2023-08-22 15:36:52 +00:00
|
|
|
- name: Run core tests
|
2023-05-11 01:57:39 +00:00
|
|
|
shell: bash
|
2023-08-22 15:36:52 +00:00
|
|
|
run: make test
|
2023-09-06 15:15:16 +00:00
|
|
|
|
|
|
|
- name: Ensure the tests did not create any additional files
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
STATUS="$(git status)"
|
|
|
|
echo "$STATUS"
|
|
|
|
|
|
|
|
# grep will exit non-zero if the target message isn't found,
|
|
|
|
# and `set -e` above will cause the step to fail.
|
|
|
|
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|