-
Notifications
You must be signed in to change notification settings - Fork 2
139 lines (122 loc) · 4.37 KB
/
Copy pathtest.yml
File metadata and controls
139 lines (122 loc) · 4.37 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
on: [push, pull_request]
name: Test
jobs:
build:
name: Test ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
# Operating systems available: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
- { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04 }
- { target: x86_64-pc-windows-msvc, os: windows-latest }
- { target: aarch64-pc-windows-msvc, os: windows-11-arm }
# Wasmtime needs native memfd support unavailable under QEMU user emulation.
- { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04-arm }
# mac-14 is an M1 ARM device.
- { target: aarch64-apple-darwin, os: macos-14 }
- { target: x86_64-apple-darwin, os: macos-14, use-cross: true }
- { target: x86_64-unknown-linux-musl, os: ubuntu-22.04, use-cross: true }
env:
BUILD_CMD: cargo
steps:
- name: Checkout source code
# v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.85.0
with:
targets: ${{ matrix.job.target }}
- name: Install cross
if: matrix.job.use-cross
uses: taiki-e/install-action@1329c298aa20c3257846c9b2e0e55967df3e3c37 # v2
with:
tool: cross@0.2.5
- name: Overwrite build command env variable
if: matrix.job.use-cross
shell: bash
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
- name: Test
shell: bash
run: $BUILD_CMD test --target ${{ matrix.job.target }}
test_wasm_plugins:
name: Test WASM component plugins
runs-on: ubuntu-22.04
steps:
# v4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dtolnay/rust-toolchain@1.85.0
with:
# The tests build every bundled plugin as a component.
targets: wasm32-wasip2
# Component loading is host behaviour, so it is tested once, natively,
# rather than on every target the matrix above cross-compiles for.
- run: cargo xtask test-plugins
test_mime_db:
name: Test with MIME database
runs-on: ubuntu-22.04
steps:
# v4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dtolnay/rust-toolchain@1.85.0
# This runs tests that rely on the MIME database being present.
- run: cargo test -- --ignored
test_linux_latest_stable:
name: Test Linux (latest stable Rust)
runs-on: ubuntu-22.04
steps:
# v4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dtolnay/rust-toolchain@stable
- run: cargo +stable test
fmt:
name: Rustfmt
runs-on: ubuntu-22.04
steps:
# v4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dtolnay/rust-toolchain@1.85.0
- run: cargo fmt --all -- --check
actionlint:
name: Actionlint
runs-on: ubuntu-22.04
steps:
# v4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: raven-actions/actionlint@205b530c5d9fa8f44ae9ed59f341a0db994aa6f8 # v2
with:
shellcheck: false
typo-check:
name: Typo Check
runs-on: ubuntu-22.04
timeout-minutes: 10
env:
FORCE_COLOR: 1
TYPOS_VERSION: v1.38.1
steps:
# v4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Download typos
run: curl -LsSf https://github.com/crate-ci/typos/releases/download/$TYPOS_VERSION/typos-$TYPOS_VERSION-x86_64-unknown-linux-musl.tar.gz | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Check for typos
run: typos
test_typescript:
name: Test @dev.fast/diffr
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
# v4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.10
- uses: dtolnay/rust-toolchain@1.85.0
- run: cargo build --locked
- working-directory: diffr-ts
run: |
bun install --frozen-lockfile
bun run typecheck
bun run build
bun test