1
0
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:
Kristoffer Dalby 2022-05-27 10:22:46 +01:00
parent 3e38824f21
commit 51f15a1317

View File

@ -13,11 +13,6 @@ jobs:
runs-on: ubuntu-latest
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
with:
fetch-depth: 2
@ -33,6 +28,24 @@ jobs:
integration_test/
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
uses: actions/cache@v3
if: steps.changed-files.outputs.any_changed == 'true'
@ -43,25 +56,14 @@ jobs:
${{ runner.os }}-go-build-
- name: Go Mod Cache
uses: actions/cache@v2
uses: actions/cache@v3
if: steps.changed-files.outputs.any_changed == 'true'
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ 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
if: steps.changed-files.outputs.any_changed == 'true'
run: nix build