Skip to content

Another using just actions/setup-python and actions/cache #61

Another using just actions/setup-python and actions/cache

Another using just actions/setup-python and actions/cache #61

Workflow file for this run

# SPDX-FileCopyrightText: 2022 Carnegie Mellon University
# SPDX-License-Identifier: 0BSD
name: python
on:
pull_request:
branches: [main]
push:
branches: [main]
env:
PYTHONUNBUFFERED: 1
jobs:
pre-commit:
name: Rerun pre-commit checks
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Run pre-commit checks
uses: pre-commit/action@v3.0.0
tests:
name: Tests
needs: pre-commit
strategy:
matrix:
python-version: ["3.7", "3.10"]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
pipx install poetry
echo "POETRY_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
- name: Cache poetry
uses: actions/cache@v3
with:
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-${{ matrix.python-version }}

Check failure on line 51 in .github/workflows/python.yml

View workflow run for this annotation

GitHub Actions / python

Invalid workflow file

The workflow is not valid. .github/workflows/python.yml (Line: 51, Col: 9): Unexpected value 'restore-keys'
- name: Install project dependencies
run: poetry install --no-interaction
- name: Run tests
run: poetry run pytest -v tests/