Skip to content

chore: reorganize directories #798

chore: reorganize directories

chore: reorganize directories #798

Workflow file for this run

name: Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --verbose
test262:
permissions: write-all
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- name: Init submodule
run: |
git submodule init
git submodule update
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 9
- name: Build NAPI
run: |
pnpm i
pnpm build
working-directory: ./packages/napi
- name: Run Test262
run: |
pnpm i
pnpm test
working-directory: ./tasks/test262
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: Test262 result
path: |
./tasks/test262/failed.txt
./tasks/test262/stat.txt
# Comment stat.txt to the commit or PR
- name: Send comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');
const stat = fs.readFileSync('./tasks/test262/stat.txt', 'utf-8');
const body = stat.slice(0, 50000);
if (context.issue.number) {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
} else {
github.rest.repos.createCommitComment({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
}
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 9
- name: Build NAPI
run: |
pnpm i
pnpm build
working-directory: ./packages/napi
- name: Build e2e tests
run: |
pnpm i
pnpm build-shaken
working-directory: ./tasks/e2e
- name: Run e2e tests
run: |
pnpm exec playwright install --with-deps chromium
pnpm test
working-directory: ./tasks/e2e