80 lines (65 loc) · 2.54 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
73
74
75
76
77
78
79
80
name: Test the GitHub action of this repository
on: [push]
jobs:
test-build-and-cache-by-root:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, mac-m1]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- # For an external repo wishing to use this action, the uses field needs to be:
# uses: kadena-io/setup-nix-with-cache/by-root@{The version you want to use}
uses: ./by-root
with:
cache_url: s3://nodemon-nix-cache?region=us-east-1
signing_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
additional_experimental_features: recursive-nix
- uses: ./copy-root-aws-credentials
- name: Attempt to build a new derivation with Nix
run: |
nix-build .github/workflows/test.nix -A alwaysNewDerivation
- name: Attempt to fetch an existing cache entry
run: |
nix-build .github/workflows/test.nix -A constantDerivation
- name: Test the recursive-nix additional_experimental_features flag
run: |
nix-build .github/workflows/test.nix -A recursiveNixDerivation
test-build-and-cache-by-runner:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, mac-m1]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: ./by-runner
with:
cache_url: s3://nodemon-nix-cache?region=us-east-1
signing_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
additional_experimental_features: recursive-nix
- uses: ./copy-root-aws-credentials
- name: Attempt to build a new derivation with Nix
run: |
nix-build .github/workflows/test.nix -A alwaysNewDerivation
- name: Attempt to fetch an existing cache entry
run: |
nix-build .github/workflows/test.nix -A constantDerivation
- name: Test the recursive-nix additional_experimental_features flag
run: |
nix-build .github/workflows/test.nix -A recursiveNixDerivation