-
Notifications
You must be signed in to change notification settings - Fork 18
178 lines (155 loc) · 4.73 KB
/
ci.actions.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
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
174
175
176
177
178
on:
pull_request:
workflow_call:
jobs:
build:
runs-on: ${{ matrix.platform.os }}
outputs:
pkg: ${{ steps.build.outputs.pkgjson }}
env:
PKGX_PANTRY_PATH: ${{github.workspace}}/co
strategy:
matrix:
platform:
- os: ubuntu-latest
name: linux
- os: macos-latest
name: darwin
steps:
- uses: actions/checkout@v4
with:
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
- uses: pkgxdev/setup@v2
- uses: ./co/build
id: build
with:
pkg: stark.com/foo
- run: test ${{ steps.build.outputs.pkgspec }} = stark.com/foo=2.3.4
- run: test ${{ steps.build.outputs.project }} = stark.com/foo
- run: test ${{ steps.build.outputs.version }} = 2.3.4
- run: test ${{ steps.build.outputs.platform }} = ${{ matrix.platform.name }}
- run: test ${{ steps.build.outputs.arch }} = x86-64
- run: test -d ${{ steps.build.outputs.prefix }}
- run: test $BREWKIT_PKGSPEC = ${{ steps.build.outputs.pkgspec }}
- run: test $BREWKIT_PREFIX = ${{ steps.build.outputs.prefix }}
- uses: ./co/upload-build-artifact
test:
needs: build
strategy:
matrix:
platform-key:
- darwin+x86-64
- null
runs-on: ubuntu-latest
env:
PKGX_PANTRY_PATH: ${{github.workspace}}/co
steps:
- uses: actions/checkout@v4
with:
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
- uses: pkgxdev/setup@v2
- uses: ./co/download-build-artifact
with:
pkg: ${{ needs.build.outputs.pkg }}
platform: ${{ matrix.platform-key }}
- uses: ./co/test
with:
pkg: ${{ needs.build.outputs.pkg }}
audit:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
env:
PKGX_PANTRY_PATH: ${{github.workspace}}/co
steps:
- uses: actions/checkout@v4
with:
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
- uses: pkgxdev/setup@v2
- uses: ./co/download-build-artifact
with:
pkg: ${{ needs.build.outputs.pkg }}
- uses: ./co/audit
with:
pkg: ${{ needs.build.outputs.pkg }}
bottle:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
compression: [xz, gz]
platform:
- darwin+x86-64
- linux+x86-64
env:
PKGX_PANTRY_PATH: ${{github.workspace}}/co
steps:
- uses: actions/checkout@v4
with:
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
- uses: pkgxdev/setup@v2
- uses: ./co/download-build-artifact
id: dl
with:
extract: false
platform: ${{ matrix.platform }}
pkg: ${{ needs.build.outputs.pkg }}
- uses: ./co/bottle
id: bottle
with:
file: ${{ steps.dl.outputs.filename }}
compression: ${{matrix.compression}}
- uses: actions/upload-artifact@v4
with:
path: ${{ steps.bottle.outputs.filename }}
name: ${{ steps.bottle.outputs.name }}
unavailable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pkgxdev/setup@v2
- uses: ./build
id: build
with:
pkg: unavailable.com
env:
PKGX_PANTRY_PATH: ${{github.workspace}}
- run: echo ${{steps.build.outputs.noop}}
- run: exit 1
if: ${{steps.build.outputs.noop != 'true'}}
id:
env:
PKGX_PANTRY_PATH: ${{github.workspace}}
runs-on: ubuntu-latest
outputs:
pkgs: ${{ steps.id.outputs.pkgs }}
steps:
- uses: actions/checkout@v4
- uses: pkgxdev/setup@v2
- uses: ./id
id: id
with:
pkg: stark.com/foo
env:
PKGX_PANTRY_PATH: ${{github.workspace}}
- run: test ${{ steps.id.outputs.version }} = 2.3.4
- run: test ${{ steps.id.outputs.version-raw }} = 2.3.4
- run: test -z "${{ steps.id.outputs.version-tag }}"
- uses: ./build
with:
pkg: ${{ steps.id.outputs.pkg-json }}
- uses: ./id
id: id2
with:
pkg: toolchain.com
- run: test v${{ steps.id2.outputs.version }} = ${{ steps.id2.outputs.version-tag }}
- run: test ${{ steps.id2.outputs.version-raw }} = ${{ steps.id2.outputs.version }}
# test that running off the `BREWKIT_PKGJSON` that the id action sets works
- uses: ./build
id: build
- run: test ${{ steps.build.outputs.project }} = 'toolchain.com'
- uses: ./test