-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (58 loc) · 1.91 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: "Test"
on:
pull_request:
push:
branches:
- main
jobs:
ubuntu_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Add a separate step to adjust permissions
- name: Adjust Permissions on Nix Store
run: sudo mkdir /nix && sudo chown -R $USER:$USER /nix/store
- name: Cache Nix Store
uses: actions/cache@v3
with:
path: /nix/store
key: nix-store-${{ runner.os }}-${{ hashFiles('**/shell.nix') }}
restore-keys: |
nix-store-${{ runner.os }}-
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: devenv
- name: Install devenv.sh
run: nix profile install nixpkgs#devenv
- name: Build the devenv shell and run any pre-commit hooks
run: devenv test
macos_tests:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Cache Nix Store
uses: actions/cache@v3
with:
path: /nix/store
key: nix-store-${{ runner.os }}-${{ hashFiles('**/shell.nix') }}
restore-keys: |
nix-store-${{ runner.os }}-
- name: Setup Docker (macOS) with Colima
run: |
brew install docker docker-compose colima
colima delete
colima start --arch x86_64
echo $SHELL
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
docker --version
curl -s --unix-socket $HOME/.colima/default/docker.sock http/_ping
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: devenv
- name: Install devenv.sh
run: nix profile install nixpkgs#devenv
- name: Build the devenv shell and run any pre-commit hooks
run: devenv test