Skip to content

Commit

Permalink
setup e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 3, 2024
1 parent 8a092fa commit 693d369
Show file tree
Hide file tree
Showing 11 changed files with 1,208 additions and 2 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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: oxc

- run: mv oxc ../oxc

- 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: transform-ci
path: ./target/release/transform-ci

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 }}

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: transform-ci

- name: chmod +x transform-ci
run: chmod +x ./transform-ci

- name: Transform
run: ./transform-ci ${{ matrix.transform_directories }}

- name: Check
run: |
corepack enable
pnpm i
${{ matrix.command }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
/node_modules
/repos
1 change: 1 addition & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use_small_heuristics = "Max"
Loading

0 comments on commit 693d369

Please sign in to comment.