-
Notifications
You must be signed in to change notification settings - Fork 8
162 lines (140 loc) · 4.38 KB
/
vorpal.yaml
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
name: vorpal
on:
pull_request:
push:
branches:
- main
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./script/dev.sh # pre-bake
- run: ./script/dev.sh make format
- run: ./script/dev.sh make lint
package:
needs:
- code-quality
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- macos-latest
- ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./script/dev.sh # pre-bake
- run: ./script/dev.sh make dist
- run: |
echo "ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "OS=$(uname -s | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: vorpal-dist-${{ env.ARCH }}-${{ env.OS }}
path: dist
test:
needs:
- package
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- macos-latest
- ubuntu-latest
steps:
- uses: actions/checkout@v4
- if: matrix.runner == 'ubuntu-latest'
run: |
./script/dev/debian.sh
cat > bwrap << EOF
abi <abi/4.0>,
include <tunables/global>
profile bwrap /usr/bin/bwrap flags=(unconfined) {
userns,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/bwrap>
}
EOF
sudo mv bwrap /etc/apparmor.d/bwrap
sudo systemctl restart apparmor.service
- run: ./script/install.sh
- run: |
echo "ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "OS=$(uname -s | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
with:
name: vorpal-dist-${{ env.ARCH }}-${{ env.OS }}
- run: |
mkdir -pv ./dist
tar -xzvf ./vorpal-${ARCH}-${OS}.tar.gz -C ./dist
- run: ./dist/vorpal keys generate
- uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- run: |
./dist/vorpal start --registry-backend "gha" \
> worker_output.log 2>&1 &
WORKER_PID=$(echo $!)
echo "WORKER_PID=$WORKER_PID" >> $GITHUB_ENV
echo "Worker pid: $WORKER_PID"
- run: ./dist/vorpal artifact --name "vorpal-shell"
- run: ./dist/vorpal artifact --name "vorpal"
- if: always()
run: |
cat worker_output.log || true
kill $WORKER_PID || true
# release:
# needs:
# - test
# permissions:
# attestations: write
# contents: write
# id-token: write
# packages: write
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
#
# - uses: actions/download-artifact@v4
# with:
# fail-on-cache-miss: true
# pattern: vorpal-*
#
# - run: git fetch --tags
#
# - if: github.ref == 'refs/heads/main'
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# if gh release view edge > /dev/null 2>&1; then
# gh release delete --cleanup-tag --yes edge
# fi
# git tag edge
# git push --tags
#
# - if: github.ref == 'refs/heads/main'
# uses: softprops/action-gh-release@v2
# with:
# body: Latest artifacts from `main` branch when merged.
# fail_on_unmatched_files: true
# files: |
# vorpal-aarch64-linux/vorpal-aarch64-linux.tar.gz
# vorpal-x86_64-linux/vorpal-x86_64-linux.tar.gz
# name: edge
# prerelease: true
# tag_name: refs/tags/edge
#
# - run: |
# mkdir -p dist/aarch64-linux
# mkdir -p dist/x86_64-linux
# tar -xzf vorpal-aarch64-linux/vorpal-aarch64-linux.tar.gz -C dist/aarch64-linux
# tar -xzf vorpal-x86_64-linux/vorpal-x86_64-linux.tar.gz -C dist/x86_64-linux
#
# - if: github.ref == 'refs/heads/main'
# uses: actions/attest-build-provenance@v1
# with:
# subject-path: |
# dist/aarch64-linux/vorpal
# dist/x86_64-linux/vorpal