ci: split workflows for PRs and `main` branch
ADD
.github/workflows/main.yml
+
+# This workflow run when something is pushed on main and it does:
+ # - normal checks like in the normal PRs
+ # - runs the coverage and prints in the command line
+name: CI on main
+on:
+ push:
+ branches:
+ - main
+
+env:
+ RUST_LOG: info
+ RUST_BACKTRACE: 1
+
+jobs:
+ format:
+ name: format
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: 1.56.1
+ profile: minimal
+ components: rustfmt
+ - name: Run rustfmt
+ uses: actions-rs/cargo@v1
+ with:
+ command: fmt
+ args: --all --verbose -- --check
+
+ lint:
+ name: lint
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: 1.56.1
+ profile: minimal
+ components: clippy
+ - name: Run clippy
+ uses: actions-rs/cargo@v1
+ with:
+ command: clippy
+ args: --workspace --all-targets --verbose -- --deny warnings
+
+ test:
+ name: test
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: 1.56.1
+ - name: Cache
+ uses: Swatinem/rust-cache@v1
+ - name: Compile for tests
+ uses: actions-rs/cargo@v1
+ with:
+ command: test
+ args: --no-run --workspace --verbose
+ - name: Run tests
+ uses: actions-rs/cargo@v1
+ env:
+ RUST_TEST_THREADS: 1
+ with:
+ command: test
+ args: --workspace --verbose
+ coverage:
+ name: Test262 coverage
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [windows-latest, ubuntu-latest]
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ submodules: recursive
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: 1.56.1
+ profile: minimal
+ - name: Cache
+ uses: Swatinem/rust-cache@v1
+ - name: Run Test262 suite
+ continue-on-error: true
+ run: cargo xtask coverage
+

RENAME
.github/workflows/ci.yml
.github/workflows/pul_request.yml
-name: CI
+
+# Jobs run on pull request
+name: Pull request
on:
- push:
- branches:
- - main
pull_request:
branches:
- main

MODIFY
.github/workflows/test262.yml
.github/workflows/test262.yml
-name: CI
+# Test coverage job. It is run on pull request because it prints the results via comment
+name: Test262 coverage and comparison
on:
- push:
- branches:
- - main
pull_request:
branches:
- main

ci: split workflows for PRs and `main` branch (#1823)