From fdb0a6ce940969081218076c186a506a151dd0fd Mon Sep 17 00:00:00 2001 From: Peter Van Dyken Date: Mon, 25 Sep 2023 16:23:41 -0400 Subject: [PATCH] Move poetry-cache-id default into action --- .github/actions/install-project/action.yml | 6 +++--- .github/workflows/test.yml | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/actions/install-project/action.yml b/.github/actions/install-project/action.yml index 5f0ab406..d42a612d 100644 --- a/.github/actions/install-project/action.yml +++ b/.github/actions/install-project/action.yml @@ -4,8 +4,8 @@ inputs: python-version: required: true description: Python version to install - reference: - required: true + poetry-cache-id: + default: ${{ github.event.pull_request.id || github.event.after }} description: > Reference ID to use for defining poetry cache (e.g. pull request id or commit SHA) @@ -19,7 +19,7 @@ runs: uses: actions/cache@v3 with: path: ~/.local - key: ${{ runner.os }}-poetry-${{ inputs.reference }} + key: ${{ runner.os }}-poetry-${{ inputs.poetry-cache-id }} - name: Install Poetry uses: snok/install-poetry@v1 if: steps.cached-poetry.outputs.cache-hit != 'true' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd5377bc..2cc48fa8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,6 @@ jobs: uses: ./.github/actions/install-project with: python-version: '3.11' - reference: ${{ github.event.pull_request.id || github.event.after }} # run python style checks - name: Poetry Lock Check @@ -50,7 +49,6 @@ jobs: - uses: ./.github/actions/install-project with: python-version: ${{ matrix.python-version }} - reference: ${{ github.event.pull_request.id || github.event.after }} # Build docker container needed for test - name: Set up QEMU