diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c42429d9..3bcf070f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 2ac023ac..bc6db21b 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7939231e..667483b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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