add new snapshot tests #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow run when something is pushed on main and it does: | |
# - normal checks like in the normal PRs | |
# - expand the test suite to be run on multiple OS | |
# - runs the coverage and prints in the command line | |
name: CI on main | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- next | |
env: | |
RUST_LOG: info | |
RUST_BACKTRACE: 1 | |
RUSTUP_WINDOWS_PATH_ADD_BIN: 1 | |
jobs: | |
format: | |
name: Format Rust Files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Support longpaths | |
run: git config core.longpaths true | |
- name: Checkout repository | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Free Disk Space | |
uses: ./.github/actions/free-disk-space | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1 | |
with: | |
components: rustfmt | |
bins: taplo-cli | |
cache-base: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run rustfmt | |
run: | | |
cargo fmt --all --verbose -- --check | |
taplo format --check | |
lint: | |
name: Lint Rust Files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Free Disk Space | |
uses: ./.github/actions/free-disk-space | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1 | |
with: | |
components: clippy | |
cache-base: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run cargo check | |
run: cargo check --workspace --all-targets --release | |
- name: Run clippy | |
run: cargo lint | |
check-dependencies: | |
name: Check Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Free Disk Space | |
uses: ./.github/actions/free-disk-space | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1 | |
with: | |
channel: nightly | |
cache: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install udeps | |
run: cargo install cargo-udeps --locked | |
- name: Run udeps | |
run: cargo +nightly udeps --all-targets | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
- os: ubuntu-latest | |
- os: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Free Disk Space | |
uses: ./.github/actions/free-disk-space | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1 | |
with: | |
cache-base: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run tests on ${{ matrix.os }} | |
run: cargo test --workspace | |
coverage: | |
name: Test262 Coverage | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ windows-latest, ubuntu-latest ] | |
steps: | |
# ref: https://github.com/orgs/community/discussions/26952 | |
- name: Support longpaths | |
if: matrix.os == 'windows-latest' | |
run: git config --system core.longpaths true | |
- name: Checkout repository | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
with: | |
submodules: recursive | |
- name: Free Disk Space | |
uses: ./.github/actions/free-disk-space | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1 | |
with: | |
cache-target: release | |
cache-base: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Compile | |
run: cargo build --release --locked -p xtask_coverage | |
- name: Run Test262 suite | |
continue-on-error: true | |
run: cargo coverage | |
- name: Clean cache | |
run: cargo cache --autoclean |