From 8f670547e081bf3cb6ad3ccb1b7aa23b232aba19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Srokosz?= Date: Wed, 31 Jul 2024 16:16:55 +0200 Subject: [PATCH] CI: Lint and test (#8) * CI: Lint and test * No need to install requirements * Download PDBs and cache --- .github/workflows/lint-test.yml | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/lint-test.yml diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml new file mode 100644 index 0000000..a26033c --- /dev/null +++ b/.github/workflows/lint-test.yml @@ -0,0 +1,43 @@ +name: "Lint and test drakpdb" +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: CERT-Polska/lint-python-action@v2 + with: + install-requirements: false + python-version: 3.8 + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: 3.8 + cache: 'pip' + - run: pip install . -r tests/requirements.txt + - uses: actions/cache/restore@v4 + id: cache-pdbs-restore + with: + path: | + tests/pdbs/*.pdb + key: pdbs-${{ hashFiles('tests/pdbs/pdbs.toml') }} + - if: ${{ steps.cache-pdbs-restore.outputs.cache-hit != 'true' }} + name: Download PDBs for test + run: python tests/fetch_pdbs.py + - if: ${{ steps.cache-pdbs-restore.outputs.cache-hit != 'true' }} + uses: actions/cache/save@v4 + with: + path: | + tests/pdbs/*.pdb + key: pdbs-${{ hashFiles('tests/pdbs/pdbs.toml') }} + - run: pytest