From e9a2c6c7e813de8649e34159b8cc2e601e0d354b Mon Sep 17 00:00:00 2001 From: Talmaj Marinc Date: Sun, 15 Sep 2024 20:54:28 +0200 Subject: [PATCH] Add lint_and_test github action. --- .github/workflows/lint_and_test.yml | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/lint_and_test.yml diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml new file mode 100644 index 0000000..902498d --- /dev/null +++ b/.github/workflows/lint_and_test.yml @@ -0,0 +1,41 @@ +name: Lint and Test + +on: [pull_request] + +jobs: + test: + runs-on: ubuntu-latest + container: + image: divio/multi-python + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + run: | + pip install -r requirements.txt + + - name: Run tests + run: | + bash download_fixtures.sh + tox + + - name: Upload coverage to GitHub Artifacts + uses: actions/upload-artifact@v4 + with: + name: coverage + path: htmlcov/ \ No newline at end of file