-
Notifications
You must be signed in to change notification settings - Fork 45
144 lines (120 loc) · 4.35 KB
/
Copy pathci.yml
File metadata and controls
144 lines (120 loc) · 4.35 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
name: CI
on:
push:
branches:
- main
pull_request:
permissions: {}
defaults:
run:
shell: bash
jobs:
tests:
name: Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install just
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: just
- name: Install DotSlash
uses: facebook/install-dotslash@1e4e7b3e07eaca387acb98f1d4720e0bee8dbb6a # v2
- name: Configure Buck2 launcher on Windows
if: runner.os == 'Windows'
run: |
echo 'BUCK2=dotslash ./buck2' >> "$GITHUB_ENV"
echo 'MSYS2_ARG_CONV_EXCL=//' >> "$GITHUB_ENV"
- name: Run Starlark lint
run: just lint-starlark
- name: Lint TypeScript
if: runner.os == 'Linux'
run: just lint-ts
- name: Check formatting
if: runner.os == 'Linux'
run: just fmt-check
- name: Run Wasmtime Buck tests
run: just test
- name: Run jco Buck tests
run: just test-jco
- name: Run extra Buck runtime tests
if: runner.os == 'Linux'
run: just test-extra-runtimes
- name: Build dist archive
run: just dist
- name: Copy dist archive
if: runner.os == 'Linux'
run: |
mkdir -p dist-artifact
cp "$(./buck2 build --show-output //tests:dist | awk '/root\/\/tests:dist/{print $2}')" dist-artifact/wasi-testsuite.tar.gz
- name: Upload dist archive
if: runner.os == 'Linux'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wasi-testsuite-dist
path: dist-artifact/wasi-testsuite.tar.gz
if-no-files-found: error
publish-test-binaries:
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
runs-on: ubuntu-latest
needs: [tests]
permissions:
contents: write
steps:
- name: Check out repository code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
ref: prod/testsuite-base
- name: Configure git
uses: ./.github/actions/git-config
- name: Merge main branch changes
run: |
git merge --no-commit --strategy ours ${{ github.sha }}
git checkout --no-overlay ${{ github.sha }} .
git checkout HEAD tests/assemblyscript/testsuite
git checkout HEAD tests/c/testsuite
git checkout HEAD tests/rust/testsuite
git diff --quiet HEAD || git commit -m "Merge commit ${{ github.sha }} into prod/testsuite-base"
- name: Download dist archive
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: wasi-testsuite-dist
- name: Extract dist archive
run: |
mkdir -p dist
tar -xzf wasi-testsuite.tar.gz -C dist
- name: Remove existing binaries
run: |
rm -rf tests/assemblyscript/testsuite
rm -rf tests/c/testsuite
rm -rf tests/rust/testsuite
- name: Copy Buck-built test binaries
run: |
cp -R dist/wasi-testsuite/tests/assemblyscript/testsuite tests/assemblyscript/testsuite
cp -R dist/wasi-testsuite/tests/c/testsuite tests/c/testsuite
cp -R dist/wasi-testsuite/tests/rust/testsuite tests/rust/testsuite
- name: Publish changes to consumer branch
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git add -f tests/assemblyscript/testsuite
git add -f tests/c/testsuite
git add -f tests/rust/testsuite
git diff --quiet HEAD || git commit -m "Update prebuilt test binaries after commit ${{ github.sha }}"
auth="$(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 | tr -d '\n')"
git -c "http.https://github.com/.extraheader=AUTHORIZATION: basic $auth" push origin HEAD:prod/testsuite-base