-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tag advisory URLs for v6 references (#491)
* tag advisory URLs Signed-off-by: Alex Goodman <[email protected]> * bust cache Signed-off-by: Alex Goodman <[email protected]> * use go cache from install action Signed-off-by: Alex Goodman <[email protected]> * rework poetry install Signed-off-by: Alex Goodman <[email protected]> * ensure no side effects on cli env vars Signed-off-by: Alex Goodman <[email protected]> --------- Signed-off-by: Alex Goodman <[email protected]>
- Loading branch information
Showing
7 changed files
with
47 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,11 +32,11 @@ inputs: | |
cache-key-prefix: | ||
description: "Prefix all cache keys with this value" | ||
required: true | ||
default: "831180ac26" | ||
default: "311808ac26" | ||
build-cache-key-prefix: | ||
description: "Prefix build cache key with this value" | ||
required: true | ||
default: "f8b6d31deb" | ||
default: "6d31debf8b" | ||
tools: | ||
description: "whether to install tools" | ||
default: "true" | ||
|
@@ -57,28 +57,25 @@ runs: | |
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Install poetry | ||
- name: Install Poetry | ||
if: inputs.python == 'true' | ||
uses: abatilo/actions-poetry@3765cf608f2d4a72178a9fc5b918668e542b89b1 # v4.0.0 | ||
with: | ||
poetry-version: ${{ inputs.poetry-version }} | ||
shell: bash | ||
run: | | ||
pipx install poetry==${{ inputs.poetry-version }} | ||
- name: Cache Poetry virtualenv | ||
uses: actions/[email protected] | ||
if: inputs.python == 'true' && inputs.use-poetry-cache == 'true' | ||
id: cache | ||
- name: Cache Poetry cache | ||
uses: actions/cache@v4 | ||
if: inputs.python == 'true' | ||
with: | ||
path: ~/.virtualenvs | ||
key: ${{ inputs.cache-key-prefix }}-${{ hashFiles('poetry.lock') }} | ||
restore-keys: | | ||
${{ inputs.cache-key-prefix }}- | ||
path: ~/.cache/pypoetry | ||
key: poetry-cache-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.poetry-version }} | ||
|
||
- name: Setup Poetry config | ||
- name: Cache Packages | ||
uses: actions/cache@v4 | ||
if: inputs.python == 'true' | ||
shell: bash | ||
run: | | ||
poetry config virtualenvs.in-project false | ||
poetry config virtualenvs.path ~/.virtualenvs | ||
with: | ||
path: ~/.local | ||
key: poetry-local-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }} | ||
|
||
- name: Bootstrap python dependencies | ||
if: inputs.python == 'true' | ||
|
@@ -93,35 +90,11 @@ runs: | |
path: ${{ github.workspace }}/.tool | ||
key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-tool-${{ hashFiles('.binny.yaml') }} | ||
|
||
# note: we need to keep restoring the go mod cache before bootstrapping tools since `go install` is used in | ||
# some installations of project tools. | ||
- name: Restore go module cache | ||
id: go-mod-cache | ||
if: inputs.go == 'true' && inputs.use-go-cache == 'true' | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-go-module-${{ inputs.go-version }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ inputs.cache-key-prefix }}-${{ runner.os }}-go-module-${{ inputs.go-version }}- | ||
- name: (cache-miss) Bootstrap project tools | ||
shell: bash | ||
if: steps.tool-cache.outputs.cache-hit != 'true' && inputs.tools == 'true' | ||
run: make bootstrap-tools | ||
|
||
- name: Restore go build cache | ||
id: go-cache | ||
if: inputs.go == 'true' && inputs.use-go-cache == 'true' | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
key: ${{ inputs.cache-key-prefix }}-${{ inputs.build-cache-key-prefix }}-${{ runner.os }}-go-build-${{ inputs.go-version }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ inputs.cache-key-prefix }}-${{ inputs.build-cache-key-prefix }}-${{ runner.os }}-go-build-${{ inputs.go-version }}- | ||
- name: (cache-miss) Bootstrap go dependencies | ||
shell: bash | ||
if: inputs.go == 'true' && steps.go-mod-cache.outputs.cache-hit != 'true' && inputs.use-go-cache == 'true' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters