oxlint ecosystem ci #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: oxlint ecosystem ci | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize] | |
paths-ignore: | |
- '**/*.md' | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**/*.md' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Build | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout oxc | |
uses: actions/checkout@v4 | |
with: | |
repository: oxc-project/oxc | |
ref: 05-11-feat_linter_eslint_add_no_unreachable_rule | |
- name: Install Rust | |
uses: Boshen/setup-rust@main | |
with: | |
save-cache: ${{ github.ref_name == 'main' }} | |
- name: Build oxlint | |
run: cargo oxlint | |
- name: Upload Binary | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
name: oxlint | |
path: ./target/release/oxlint | |
checkout: | |
name: Read matrix.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: ./matrix.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 |