Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node matrix #66

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
371 changes: 191 additions & 180 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,137 +31,148 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
build:
name: Build
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1

- name: Checkout oxc (${{ inputs.ref }})
uses: actions/checkout@v4
with:
repository: oxc-project/oxc
ref: ${{ inputs.ref }}
path: oxc

- run: mv oxc ../oxc

- uses: Boshen/setup-rust@main
with:
save-cache: ${{ github.ref_name == 'main' }}

- run: cargo build --release
env:
RUSTFLAGS: "-C debug-assertions=true"

- name: Upload Binary
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: monitor-oxc
path: ./target/release/monitor-oxc

# populate pnpm cache

- uses: pnpm/[email protected]
# build:
# name: Build
# timeout-minutes: 10
# runs-on: ubuntu-latest
# steps:
# - uses: taiki-e/checkout-action@v1

# - name: Checkout oxc (${{ inputs.ref }})
# uses: actions/checkout@v4
# with:
# repository: oxc-project/oxc
# ref: ${{ inputs.ref }}
# path: oxc

# - run: mv oxc ../oxc

# - uses: Boshen/setup-rust@main
# with:
# save-cache: ${{ github.ref_name == 'main' }}

# - run: cargo build --release
# env:
# RUSTFLAGS: "-C debug-assertions=true"

# - name: Upload Binary
# uses: actions/upload-artifact@v4
# with:
# if-no-files-found: error
# name: monitor-oxc
# path: ./target/release/monitor-oxc

# # populate pnpm cache

# - uses: pnpm/[email protected]

# - uses: actions/setup-node@v4
# with:
# node-version-file: .node-version
# registry-url: "https://registry.npmjs.org"
# cache: pnpm

# - run: pnpm install --frozen-lockfile

# test:
# name: Test
# needs: build
# timeout-minutes: 30
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# include:
# - command: codegen
# - command: compressor
# - command: transformer
# - command: mangler
# - command: whitespace
# steps:
# - uses: taiki-e/checkout-action@v1

# - uses: actions/download-artifact@v4
# with:
# name: monitor-oxc

# - run: chmod +x ./monitor-oxc

# - uses: pnpm/[email protected]

# - uses: actions/setup-node@v4
# with:
# node-version-file: .node-version
# cache: pnpm

# - run: pnpm install

# - run: ./monitor-oxc ${{ matrix.command }}
# env:
# RUST_BACKTRACE: "1"

# isolated_declarations:
# needs: build
# name: Test Isolated Declarations
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# repository: vuejs/core
# ref: main

# - uses: pnpm/[email protected]

# - uses: actions/setup-node@v4
# with:
# node-version-file: .node-version
# cache: pnpm

# - run: pnpm install

# - run: ./node_modules/.bin/tsc -p tsconfig.build.json --noCheck

# - uses: actions/download-artifact@v4
# with:
# name: monitor-oxc

# - run: chmod +x ./monitor-oxc

# - run: ./monitor-oxc id .

# rolldown:
# name: Rolldown
# runs-on: ubuntu-latest
# steps:
# - uses: taiki-e/checkout-action@v1
# - uses: pnpm/[email protected]
# - uses: actions/setup-node@v4
# with:
# node-version-file: .node-version
# cache: pnpm
# - run: pnpm install
# - run: ./node_modules/.bin/rolldown --version
# - run: node --run rolldown

- uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: "https://registry.npmjs.org"
cache: pnpm

- run: pnpm install --frozen-lockfile

test:
name: Test
needs: build
timeout-minutes: 30
test262:
name: Test262
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- command: codegen
- command: compressor
- command: transformer
- command: mangler
- command: whitespace
steps:
- uses: taiki-e/checkout-action@v1

- uses: actions/download-artifact@v4
with:
name: monitor-oxc

- run: chmod +x ./monitor-oxc

- uses: pnpm/[email protected]

- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm

- run: pnpm install

- run: ./monitor-oxc ${{ matrix.command }}
env:
RUST_BACKTRACE: "1"

isolated_declarations:
needs: build
name: Test Isolated Declarations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: vuejs/core
ref: main

- uses: pnpm/[email protected]

- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm

- run: pnpm install

- run: ./node_modules/.bin/tsc -p tsconfig.build.json --noCheck

- uses: actions/download-artifact@v4
with:
name: monitor-oxc

- run: chmod +x ./monitor-oxc

- run: ./monitor-oxc id .

rolldown:
name: Rolldown
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1
- uses: pnpm/[email protected]
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- run: pnpm install
- run: ./node_modules/.bin/rolldown --version
- run: node --run rolldown

test262:
name: Test262
runs-on: ubuntu-latest
- node: 22
# - node: 20
# - node: 18
# - node: 16
# - node: 14
# - node: 12
- node: 10
steps:
- name: Checkout oxc (${{ inputs.ref }})
uses: actions/checkout@v4
with:
repository: oxc-project/oxc
ref: ${{ inputs.ref }}
ref: runtime-node-version # ${{ inputs.ref }}

- uses: actions/checkout@v4
with:
Expand All @@ -177,63 +188,63 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 22.x

- run: cargo coverage runtime

- run: git diff --exit-code

comment:
needs: [test, isolated_declarations, rolldown, test262]
if: ${{ always() }}
runs-on: ubuntu-latest
name: Reply Comment
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/github-script@v7
id: script
if: ${{ inputs.issue-number }}
with:
github-token: ${{ secrets.OXC_BOT_PAT }}
result-encoding: string
script: |
const {
data: { jobs },
} = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
per_page: 100,
});
let result = jobs
.filter((job) => job.name.startsWith("Test "))
.map((job) => {
const suite = job.name.slice(5);
return { suite, conclusion: job.conclusion, link: job.html_url };
});
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const urlLink = `[Open](${url})`;
const conclusionEmoji = {
success: ":white_check_mark:",
failure: ":x:",
cancelled: ":stop_button:",
};
const body = `
## [Monitor Oxc](${urlLink})
| suite | result |
|-------|--------|
${result.map((r) => `| [${r.suite}](${r.link}) | ${conclusionEmoji[r.conclusion]} |`).join("\n")}
`;
return body;

- uses: peter-evans/create-or-update-comment@v4
if: ${{ inputs.issue-number && inputs.comment-id }}
with:
token: ${{ secrets.OXC_BOT_PAT }}
repository: oxc-project/oxc
issue-number: ${{ inputs.issue-number }}
comment-id: ${{ inputs.comment-id }}
body: ${{ steps.script.outputs.result }}
edit-mode: replace
node-version: ${{ matrix.node }}

- run: cargo coverage runtime --target node${{ matrix.node }}

- run: git diff -I"^commit:" --exit-code

# comment:
# needs: [test, isolated_declarations, rolldown, test262]
# if: ${{ always() }}
# runs-on: ubuntu-latest
# name: Reply Comment
# permissions:
# pull-requests: write
# contents: write
# steps:
# - uses: actions/github-script@v7
# id: script
# if: ${{ inputs.issue-number }}
# with:
# github-token: ${{ secrets.OXC_BOT_PAT }}
# result-encoding: string
# script: |
# const {
# data: { jobs },
# } = await github.rest.actions.listJobsForWorkflowRun({
# owner: context.repo.owner,
# repo: context.repo.repo,
# run_id: context.runId,
# per_page: 100,
# });
# let result = jobs
# .filter((job) => job.name.startsWith("Test "))
# .map((job) => {
# const suite = job.name.slice(5);
# return { suite, conclusion: job.conclusion, link: job.html_url };
# });
# const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
# const urlLink = `[Open](${url})`;
# const conclusionEmoji = {
# success: ":white_check_mark:",
# failure: ":x:",
# cancelled: ":stop_button:",
# };
# const body = `
# ## [Monitor Oxc](${urlLink})
# | suite | result |
# |-------|--------|
# ${result.map((r) => `| [${r.suite}](${r.link}) | ${conclusionEmoji[r.conclusion]} |`).join("\n")}
# `;
# return body;

# - uses: peter-evans/create-or-update-comment@v4
# if: ${{ inputs.issue-number && inputs.comment-id }}
# with:
# token: ${{ secrets.OXC_BOT_PAT }}
# repository: oxc-project/oxc
# issue-number: ${{ inputs.issue-number }}
# comment-id: ${{ inputs.comment-id }}
# body: ${{ steps.script.outputs.result }}
# edit-mode: replace
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.11.0
22.7.0
Loading
Loading