-
-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (93 loc) · 2.58 KB
/
ci.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
name: Transform CI
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**/*.md'
push:
branches:
- main
- ci
paths-ignore:
- '**/*.md'
jobs:
build:
name: Build
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: taiki-e/checkout-action@v1
- name: Checkout oxc
uses: actions/checkout@v4
with:
repository: oxc-project/oxc
ref: main
path: ../
- name: Install Rust
uses: Boshen/setup-rust@main
with:
save-cache: ${{ github.ref_name == 'main' }}
- name: Build
run: cargo build --release
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: oxlint
path: ./target/release/oxlint
checkout:
name: Read repos.json
needs: build
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setmatrix.outputs.content }}
steps:
- uses: taiki-e/checkout-action@v1
- id: setmatrix
uses: jaywcjlove/github-action-read-file@main
with:
localfile: ./repos/repos.json
test-ecosystem:
needs: checkout
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.checkout.outputs.matrix) }}
name: ${{ matrix.repository }}
steps:
- name: Clone ${{ matrix.repository }}
uses: actions/checkout@v4
with:
repository: ${{ matrix.repository }}
ref: ${{ matrix.ref }}
path: ${{ matrix.path }}
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: oxlint
path: ${{ matrix.path }}
- name: chmod +x oxlint
run: chmod +x ./oxlint
working-directory: ${{ matrix.path }}
- name: Run
working-directory: ${{ matrix.path }}
run: ${{ matrix.command }}
- name: Check Panic
working-directory: ${{ matrix.path }}
run: |
set +e # disable exit on run
./oxlint --jest-plugin --jsdoc-plugin --jsx-a11y-plugin --nextjs-plugin --react-perf-plugin -D all --silent
EXIT_CODE=$?
# Panic returns exit code > 1, e.g. 101 when a Rust program panics
if [ $EXIT_CODE -gt 1 ]; then
echo "exitcode=$EXIT_CODE" >> $GITHUB_OUTPUT
exit $EXIT_CODE
fi
echo "exitcode=0" >> $GITHUB_OUTPUT
exit 0