Skip to content

Commit

Permalink
Merge branch 'main' into missing-test-cases-4
Browse files Browse the repository at this point in the history
  • Loading branch information
JoSeBu1 authored Apr 14, 2024
2 parents d6235e5 + aa62dbb commit 0021ad4
Show file tree
Hide file tree
Showing 354 changed files with 27,438 additions and 16,568 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[alias]
# Do not append `--` or it will break IDEs
ck = "check --workspace --all-targets --locked"
ck = "check --workspace --all-features --all-targets --locked"
lint = "clippy --workspace --all-targets --all-features"
codecov = "llvm-cov --workspace --ignore-filename-regex tasks"
coverage = "run -p oxc_coverage --release --"
Expand Down
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Bug report
about: Create a report to help us improve.
title: ''
labels: C-bug
assignees: Boshen

---


12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
contact_links:
- name: Github discussions
url: https://github.com/oxc-project/oxc/discussions
about: For general discussions.

- name: Discord server
url: https://discord.gg/9uXCAwqQZW
about: For lightweight questions.

- name: Website issues
url: https://github.com/oxc-project/oxc-project.github.io
about: For website issues.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Feature request
about: Suggest an idea for this project.
title: ''
labels: C-enhancement
assignees: Boshen

---


2 changes: 1 addition & 1 deletion .github/actions/clone-submodules/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
with:
repository: babel/babel
path: tasks/coverage/babel
ref: eccbd203383487f6957dcf086aa83d773691560b
ref: acf3d17fdfe150a270c822581b709dddac4548ce

- uses: actions/checkout@v4
with:
Expand Down
12 changes: 8 additions & 4 deletions .github/actions/rustup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,19 @@ runs:
echo 'restore-cache: ${{ inputs.restore-cache }}'
echo 'save-cache: ${{ inputs.save-cache }}'
- name: Remove `profile` line on MacOS
- name: Change to minimal profile on MacOS
shell: bash
if: runner.os == 'macOS'
run: sed -i '' '/profile/d' rust-toolchain.toml
run: |
sed -i '' -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml
cat rust-toolchain.toml
- name: Remove `profile` line on non-MacOS
- name: Change to minimal profile on non-MacOS
shell: bash
if: runner.os != 'macOS'
run: sed -i '/profile/d' rust-toolchain.toml
run: |
sed -i -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml
cat rust-toolchain.toml
- name: Set minimal
shell: bash
Expand Down
2 changes: 0 additions & 2 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@ ignore:
- "crates/oxc_ast/src/span.rs"
- "crates/oxc_wasm" # Remove this once wasm is completed
- "crates/oxc_diagnostics"
- "crates/oxc_type_synthesis"
- "crates/oxc_transformer" # not ready
- "crates/oxc_js_regex" # not ready
20 changes: 20 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,31 @@
"crates/oxc_linter/fixtures/**"
],
"assignees": ["@Boshen"],
"lockFileMaintenance": {
"enabled": true
},
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^rust-toolchain\\.toml?$"],
"matchStrings": [
"channel\\s*=\\s*\"(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)\""
],
"depNameTemplate": "rust",
"lookupNameTemplate": "rust-lang/rust",
"datasourceTemplate": "github-releases"
}
],
"packageRules": [
{
"groupName": "github-actions",
"matchManagers": ["github-actions"]
},
{
"groupName": "rust toolchain",
"matchManagers": ["regex"],
"matchPackageNames": ["rust"]
},
{
"groupName": "rust crates",
"matchManagers": ["cargo"],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/checkout-action@v1
- uses: actions/labeler@v5
100 changes: 91 additions & 9 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
types: [opened, synchronize]
paths:
- '**/*.rs'
- 'napi/parser/**/*.js'
- 'napi/parser/**/*.mjs'
- 'Cargo.lock'
- '.github/workflows/benchmark.yml'
- 'tasks/benchmark/codspeed/*.mjs'
Expand All @@ -15,6 +17,8 @@ on:
- bench-*
paths:
- '**/*.rs'
- 'napi/parser/**/*.js'
- 'napi/parser/**/*.mjs'
- 'Cargo.lock'
- '.github/workflows/benchmark.yml'
- 'tasks/benchmark/codspeed/*.mjs'
Expand All @@ -31,7 +35,7 @@ jobs:
matrix:
# Run each benchmark in own job.
# Linter benchmark is by far the slowest, so split each fixture into own job.
component: [lexer, parser, transformer, semantic, minifier, codegen_sourcemap]
component: [lexer, parser, transformer, semantic, minifier, codegen_sourcemap, sourcemap]
include:
- component: linter
fixture: 0
Expand All @@ -45,10 +49,7 @@ jobs:
fixture: 4
steps:
- name: Checkout Branch
uses: actions/checkout@v4
with:
show-progress: false
persist-credentials: false
uses: taiki-e/checkout-action@v1

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
Expand Down Expand Up @@ -77,12 +78,12 @@ jobs:
pnpm install
node capture.mjs &
- name: Build Benchmark
- name: Build benchmark
env:
RUSTFLAGS: "-C debuginfo=2 -C strip=none -g --cfg codspeed"
shell: bash
run: |
cargo build --release -p oxc_benchmark --features codspeed --bench ${{ matrix.component }}
cargo build --release -p oxc_benchmark --bench ${{ matrix.component }} --features codspeed
mkdir -p target/codspeed/oxc_benchmark/
mv target/release/deps/${{ matrix.component }}-* target/codspeed/oxc_benchmark
rm -rf target/codspeed/oxc_benchmark/*.d
Expand All @@ -106,13 +107,94 @@ jobs:
if-no-files-found: error
retention-days: 1

benchmark-napi:
name: Benchmark NAPI parser
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout Branch
uses: taiki-e/checkout-action@v1
with:
show-progress: false
persist-credentials: false

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
shared-key: 'benchmark_napi'
save-cache: ${{ github.ref_name == 'main' }}

- name: Install codspeed
uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Start bench results interceptor server
working-directory: ./tasks/benchmark/codspeed
env:
COMPONENT: 'parser_napi'
run: |
corepack enable
pnpm install
node capture.mjs &
# CodSpeed gets measurements completely off for NAPI if run in `CodSpeedHQ/action`,
# so instead run real benchmark without CodSpeed's instrumentation and save the results.
# Then "Run Rust benchmark" step below runs a loop of some simple Rust code the number
# of times required to take same amount of time as the real benchmark took.
# This is all a workaround for https://github.com/CodSpeedHQ/action/issues/96
- name: Build NAPI Benchmark
working-directory: ./napi/parser
run: |
corepack enable
pnpm install
pnpm build
- name: Run NAPI Benchmark
working-directory: ./napi/parser
run: node parse.bench.mjs

- name: Build Rust benchmark
env:
RUSTFLAGS: "-C debuginfo=2 -C strip=none -g --cfg codspeed"
shell: bash
run: |
cargo build --release -p oxc_benchmark --bench parser_napi --no-default-features --features codspeed_napi
mkdir -p target/codspeed/oxc_benchmark/
mv target/release/deps/parser_napi-* target/codspeed/oxc_benchmark
rm -rf target/codspeed/oxc_benchmark/*.d
- name: Run Rust benchmark
uses: CodSpeedHQ/action@v2
timeout-minutes: 30
with:
run: cargo codspeed run
# Dummy token for tokenless runs, to suppress logging hash of metadata JSON (see `upload.mjs`)
token: ${{ secrets.CODSPEED_TOKEN || 'dummy' }}
upload-url: http://localhost:${{ env.INTERCEPT_PORT }}/upload

- name: Upload bench data artefact
uses: actions/upload-artifact@v4
with:
name: 'parser_napi'
path: ${{ env.DATA_DIR }}
if-no-files-found: error
retention-days: 1

upload:
name: Upload benchmarks
needs: benchmark
# needs: [benchmark, benchmark-napi]
needs: [benchmark]
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v4
uses: taiki-e/checkout-action@v1
with:
show-progress: false
persist-credentials: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bloat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: taiki-e/checkout-action@v1

- name: Cache
uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cargo-llvm-lines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: taiki-e/checkout-action@v1

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
Expand Down
Loading

0 comments on commit 0021ad4

Please sign in to comment.