mirror of
https://github.com/juanfont/headscale.git
synced 2025-09-25 17:51:11 +02:00
Reorder build to try to make cache work
This commit is contained in:
parent
3e38824f21
commit
51f15a1317
38
.github/workflows/build.yml
vendored
38
.github/workflows/build.yml
vendored
@ -13,11 +13,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- id: go-cache-paths
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=go-build::$(go env GOCACHE)"
|
|
||||||
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
@ -33,6 +28,24 @@ jobs:
|
|||||||
integration_test/
|
integration_test/
|
||||||
config-example.yaml
|
config-example.yaml
|
||||||
|
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/nix
|
||||||
|
key: ${{ runner.os }}-nix-${{ hashFiles('**/flake.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-nix-
|
||||||
|
|
||||||
|
- uses: cachix/install-nix-action@v16
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
|
||||||
|
- id: go-cache-paths
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=go-build::$(nix develop --command -- go env GOCACHE)"
|
||||||
|
echo "::set-output name=go-mod::$(nix develop --command -- go env GOMODCACHE)"
|
||||||
|
|
||||||
- name: Go Build Cache
|
- name: Go Build Cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
@ -43,25 +56,14 @@ jobs:
|
|||||||
${{ runner.os }}-go-build-
|
${{ runner.os }}-go-build-
|
||||||
|
|
||||||
- name: Go Mod Cache
|
- name: Go Mod Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.go-cache-paths.outputs.go-mod }}
|
path: ${{ steps.go-cache-paths.outputs.go-mod }}
|
||||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-mod-
|
${{ runner.os }}-go-mod-
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@v16
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
/nix
|
|
||||||
key: ${{ runner.os }}-nix-${{ hashFiles('**/flake.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-nix-
|
|
||||||
|
|
||||||
- name: Run build
|
- name: Run build
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
run: nix build
|
run: nix build
|
||||||
|
Loading…
Reference in New Issue
Block a user