From 2ca7dec966cb0bd3dddd0c830841169c773a8896 Mon Sep 17 00:00:00 2001 From: Henrique Bastos Date: Tue, 6 Feb 2024 20:49:54 -0300 Subject: [PATCH] Add push workflow. --- .github/workflows/push.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..049f7c1 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,32 @@ +name: Run linting and tests when pushing code. + +on: [push] + +jobs: + linting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - uses: pre-commit/action@v3.0.0 + + testing: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'poetry' + - name: Install dependencies + run: | + python -m pip install --upgrade pip poetry + poetry install + - name: Test with pytest + run: poetry run pytest