on: workflow_call: {} jobs: lint: name: Lint runs-on: ubuntu-latest steps: - name: Checkout commit uses: actions/checkout@v4 - name: Install python uses: actions/setup-python@v5 with: python-version: 3.12 - name: Cache pre-commit hooks uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: pre-commit|py3.12|${{ hashFiles('.pre-commit-config.yaml') }} - name: Install Poetry run: pip install poetry - name: Setup Python dependencies cache uses: actions/cache@v4 with: path: ~/.cache/pypoetry key: poetry-${{ hashFiles('**/poetry.lock') }} restore-keys: | poetry- - name: Install dependencies run: make install - name: Add local venv to PATH run: echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH - name: Lint run: | echo "::add-matcher::.github/actionlint-matcher.json" make lint test-unit: name: Unit tests runs-on: ubuntu-latest steps: - name: Checkout commit uses: actions/checkout@v4 - name: Install python uses: actions/setup-python@v5 with: python-version-file: .python-version cache: pip - name: Install Poetry run: pip install poetry - name: Setup Python dependencies cache uses: actions/cache@v4 with: path: ~/.cache/pypoetry key: poetry-${{ hashFiles('**/poetry.lock') }} restore-keys: | poetry- - name: Install dependencies run: make setup - name: Add local venv to PATH run: echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH - name: Run unit tests run: make test-unit check: name: Check needs: - lint runs-on: ubuntu-latest if: always() steps: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }}