diff --git a/.github/workflows/lint_type_check.yml b/.github/workflows/lint_type_check.yml index 924eaf1c..e064de9e 100644 --- a/.github/workflows/lint_type_check.yml +++ b/.github/workflows/lint_type_check.yml @@ -6,6 +6,10 @@ on: pull_request: workflow_dispatch: +env: + POETRY_VERSION: 1.4.2 + PYTHON_VERSION: "3.11" + jobs: lint-and-type-check: name: Lint and type-check @@ -16,20 +20,22 @@ jobs: uses: actions/checkout@v3 - name: Load cached .local + id: cache-poetry uses: actions/cache@v3 with: path: /home/runner/.local - key: dotlocal-3.8-${{ hashFiles('.github/workflows') }} + key: dotlocal-${{ env.POETRY_VERSION }} - name: Install poetry + if: steps.cache-poetry.outputs.cache-hit != 'true' run: | - curl -sSL https://install.python-poetry.org/ | python - + curl -sSL https://install.python-poetry.org/ | python - --version ${{ env.POETRY_VERSION }} echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Install Python + Retrieve Poetry dependencies from cache uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: ${{ env.PYTHON_VERSION }} cache: "poetry" - name: Display Python version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6c7e2e3b..53d5e06d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,10 @@ on: - ".vscode/**" workflow_dispatch: +env: + POETRY_VERSION: 1.4.2 + PYTHON_VERSION: "3.11" + jobs: test: name: Test @@ -42,7 +46,7 @@ jobs: - name: Install Python + Retrieve Poetry dependencies from cache uses: actions/setup-python@v4 with: - python-version: "${{ matrix.python-version }}" + python-version: ${{ env.PYTHON_VERSION }} cache: "poetry" - name: Display Python version