Skip to content

Commit

Permalink
ci: Attempt fix tests with go cache
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusramberg committed Nov 14, 2023
1 parent 40e80dd commit 7ca1ce6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/devenv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- uses: cachix/cachix-action@v12
- name: Check out
uses: actions/checkout@v4
- name: Install nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Install cachix
uses: cachix/cachix-action@v12
with:
name: devenv
- name: Install devenv.sh
run: nix profile install tarball+https://install.devenv.sh/latest

- name: Build the devenv shell and run any pre-commit hooks
run: devenv ci

- name: Run tests
run: devenv shell go test -race -cover ./...
- name: Setup nix cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Setup go cache
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Run pre-commit hooks
run: |
devenv shell pre-commit run --all-files
- name: Build
run: |
devenv shell go build
5 changes: 1 addition & 4 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{ pkgs, ... }:

{
env.GOPROXY = "direct";


packages = [ pkgs.git ];

languages.go.enable = true;

pre-commit.hooks.gofmt.enable = true;
pre-commit.hooks.govet.enable = true;
# pre-commit.hooks.gotest.enable = true;
pre-commit.hooks.gotest.enable = true;
pre-commit.hooks.commitizen.enable = true;
}

0 comments on commit 7ca1ce6

Please sign in to comment.