From 7ea7ed668f1fe04ce95fc3323102f3d4acf21389 Mon Sep 17 00:00:00 2001 From: Alex Clerc Date: Mon, 22 Apr 2024 11:31:51 +0100 Subject: [PATCH] Create CI.yaml --- .github/workflows/CI.yaml | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/CI.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml new file mode 100644 index 0000000..3e6649d --- /dev/null +++ b/.github/workflows/CI.yaml @@ -0,0 +1,45 @@ +name: Check format lint and test + +on: + push: + branches: [ main ] + pull_request: + +env: + python-version: "3.10" + +permissions: + contents: read + +jobs: + lint-and-test: + runs-on: ubuntu-latest + steps: + - name: "Checkout repository" + uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + name: 'Set up Python ${{ inputs.python-version }}' + with: + python-version: ${{ env.python-version }} + + - uses: actions/cache@v4 + id: cache-venv + with: + path: ./.venv/ + key: ${{ runner.os }}-venv-${{ hashFiles('**/dev-requirements.txt') }} + restore-keys: | + ${{ runner.os }}-venv- + + - name: 'Create Virtualenv and install Dependencies' + if: steps.cache-venv.outputs.cache-hit != 'true' + run: | + python -m venv .venv + source .venv/bin/activate + pip install -r dev-requirements.txt + + - name: "lint-check & test" + run: | + source .venv/bin/activate + poe lint-check + poe test