-
Notifications
You must be signed in to change notification settings - Fork 9
173 lines (167 loc) · 4.85 KB
/
Copy pathtest.yml
File metadata and controls
173 lines (167 loc) · 4.85 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: "nix-shell-action-test"
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- support-devshell
- "releases/*"
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v6
with:
node-version-file: .node-version
- run: |
npm install
- run: |
npm run all
test-latest-nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Test Basic Bash Shell
uses: ./
with:
script: |
echo "test!"
- name: Test Bash Shell with Packages
uses: ./
with:
packages: hello,docker
script: |
hello
command -v docker
- name: Test Bash Shell with Enviroment
uses: ./
env:
FUTURE: now
ANSWER: 42
with:
script: |
echo The future is $FUTURE
[[ -z "${ANSWER}" ]] && exit 1 || exit 0
test-no-stderr-noise:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Run action with packages
uses: ./
with:
packages: hello
script: |
hello
- name: Assert wrapper does not use legacy nix run
run: |
if grep -q 'nix run nixpkgs\.' dist/wrapper.sh 2>/dev/null; then
echo "FAIL: wrapper.sh contains legacy 'nix run nixpkgs.' invocation"
exit 1
fi
echo "PASS: no legacy nix run pattern found"
test-flakes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Test Basic Bash Shell with Local Flake
uses: ./
with:
flakes: .#hello
script: |
hello
- name: Test Bash Shell with Local and External Flakes
uses: ./
with:
flakes: .#hello,nixpkgs#docker
script: |
hello
command -v docker
test-local-flake-in-working-directory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Test Bash Shell with Local and External Flakes
uses: ./
with:
flakes: .#cowsay,nixpkgs#docker
working-directory: test/working-directory
script: |
pwd
cowsay hello
command -v docker
test-flakes-from-devshell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Test Bash Shell with Local and External Flakes
uses: ./
with:
flakes-from-devshell: true
script: |
pwd
figlet "I'm from the devshell, baby."
test-flakes-from-devshell-with-custom-shell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Test Bash Shell with Local and External Flakes
uses: ./
with:
flakes-from-devshell: true
custom-devshell: ci
script: |
pwd
ponysay "I'm from the CI devshell, baby."
test-flakes-from-devshell-in-working-directory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Test Bash Shell with Local Flake in a Working Directory
uses: ./
with:
working-directory: test/devshell-flake
flakes-from-devshell: true
script: |
pwd
cmatrix -h