1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-09-16 17:50:44 +02:00

Cache the Nix env, speed up builds

This commit is contained in:
Kristoffer Dalby 2022-05-18 18:10:02 +02:00
parent 747d64cdae
commit 9ead2bf5fa
3 changed files with 57 additions and 0 deletions

View File

@ -28,9 +28,28 @@ jobs:
integration_test/
config-example.yaml
- uses: actions/cache@v3
if: steps.changed-files.outputs.any_changed == 'true'
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- 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

View File

@ -22,9 +22,28 @@ jobs:
integration_test/
config-example.yaml
- uses: actions/cache@v3
if: steps.changed-files.outputs.any_changed == 'true'
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- 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 Integration tests
if: steps.changed-files.outputs.any_changed == 'true'
run: nix develop --command -- make test_integration

View File

@ -22,9 +22,28 @@ jobs:
integration_test/
config-example.yaml
- uses: actions/cache@v3
if: steps.changed-files.outputs.any_changed == 'true'
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- 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 tests
if: steps.changed-files.outputs.any_changed == 'true'
run: nix develop --check