-
-
Notifications
You must be signed in to change notification settings - Fork 503
138 lines (132 loc) · 4.27 KB
/
main.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
# This workflow run when something is pushed on main and it does:
# - normal checks like in the normal PRs
# - expand the test suite to be run on multiple OS
# - runs the coverage and prints in the command line
name: CI on main
on:
workflow_dispatch:
push:
branches:
- main
- next
env:
RUST_LOG: info
RUST_BACKTRACE: 1
RUSTUP_WINDOWS_PATH_ADD_BIN: 1
jobs:
format:
name: Format Rust Files
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Support longpaths
run: git config core.longpaths true
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Free Disk Space
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
components: rustfmt
bins: taplo-cli
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run rustfmt
run: |
cargo fmt --all --verbose -- --check
taplo format --check
lint:
name: Lint Rust Files
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Free Disk Space
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
components: clippy
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run cargo check
run: cargo check --workspace --all-targets --release
- name: Run clippy
run: cargo lint
check-dependencies:
name: Check Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Free Disk Space
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
channel: nightly
cache: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install udeps
run: cargo install cargo-udeps --locked
- name: Run udeps
run: cargo +nightly udeps --all-targets
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
- os: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Free Disk Space
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests on ${{ matrix.os }}
run: cargo test --workspace
coverage:
name: Test262 Coverage
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest ]
steps:
# ref: https://github.com/orgs/community/discussions/26952
- name: Support longpaths
if: matrix.os == 'windows-latest'
run: git config --system core.longpaths true
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Free Disk Space
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
cache-target: release
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Compile
run: cargo build --release --locked -p xtask_coverage
- name: Run Test262 suite
continue-on-error: true
run: cargo coverage
- name: Clean cache
run: cargo cache --autoclean