-
Notifications
You must be signed in to change notification settings - Fork 6
138 lines (127 loc) · 3.84 KB
/
main.yml
File metadata and controls
138 lines (127 loc) · 3.84 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
name: CI
on:
pull_request:
merge_group:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: Build wasm-component-ld
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: x86_64-linux
os: ubuntu-latest
env:
CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu
DOCKER_IMAGE: ./ci/docker/x86_64-linux/Dockerfile
- build: aarch64-linux
os: ubuntu-latest
env:
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu
DOCKER_IMAGE: ./ci/docker/aarch64-linux/Dockerfile
- build: x86_64-macos
os: macos-latest
env:
CARGO_BUILD_TARGET: x86_64-apple-darwin
MACOSX_DEPLOYMENT_TARGET: 10.12
- build: aarch64-macos
os: macos-latest
env:
CARGO_BUILD_TARGET: aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET: 10.12
- build: x86_64-windows
os: windows-latest
env:
CARGO_BUILD_TARGET: x86_64-pc-windows-msvc
RUSTFLAGS: -Ctarget-feature=+crt-static
- build: aarch64-windows
os: windows-11-arm
env:
CARGO_BUILD_TARGET: aarch64-pc-windows-msvc
RUSTFLAGS: -Ctarget-feature=+crt-static
env: ${{ matrix.env }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: rustup update stable --no-self-update && rustup default stable
- run: rustup target add $CARGO_BUILD_TARGET
- run: ./ci/build-release-artifacts.sh
- run: ./ci/build-tarballs.sh "${{ matrix.build }}"
- uses: actions/upload-artifact@v4
with:
name: bins-${{ matrix.build }}
path: dist
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
rust: stable
- os: ubuntu-latest
rust: beta
- os: ubuntu-latest
rust: nightly
- os: macos-latest
rust: stable
- os: windows-latest
rust: stable
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- run: rustup target add wasm32-wasip1
- run: cargo test --locked
msrv:
name: Build MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update 1.76.0 --no-self-update && rustup default 1.76.0
- run: cargo build
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
# Note that this doesn't use `cargo fmt` because that doesn't format
# modules-defined-in-macros which is in use in `wast` for example. This is
# the best alternative I can come up with at this time
- run: find . -name '*.rs' | xargs rustfmt --check --edition 2021
# "Join node" which the merge queue waits on.
ci-status:
name: Record the result of testing and building steps
runs-on: ubuntu-latest
needs:
- test
- rustfmt
- build
- msrv
if: always()
steps:
- name: Successful test and build
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing test and build
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
- name: Report failure on cancellation
if: ${{ contains(needs.*.result, 'cancelled') || cancelled() }}
run: exit 1