Skip to content

Fix performance regression #641

Fix performance regression

Fix performance regression #641

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.feature-flags }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs:
- check-languages-file
- lint
strategy:
fail-fast: false
matrix:
os:
- macOS-latest
- ubuntu-latest
- windows-latest
feature-flags:
- --no-default-features
- --no-default-features --features color
steps:
- uses: actions/checkout@v4
- name: Fetch Test Branches
run: git fetch origin test/javascript:test/javascript
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --verbose ${{ matrix.feature-flags }}
- name: Test
run: cargo test --verbose ${{ matrix.feature-flags }}
- name: Install tarpaulin
uses: actions-rs/install@v0.1
# NOTE: The last step fails if tarpaulin is already installed
continue-on-error: true
with:
crate: cargo-tarpaulin
version: "0.27.0"
- name: Generate Coverage
run: cargo tarpaulin --verbose ${{ matrix.feature-flags }} --workspace --timeout 120 --out xml
- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.os }},${{ matrix.feature-flags }}
token: ${{ secrets.CODECOV_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Format
run: cargo fmt -- --check
- name: Lint
run: cargo clippy -- -D warnings
check-languages-file:
name: Check Languages File
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Check Languages File
run: ruby ./scripts/check-languages-file.rb ./gengo/languages.yaml
benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 3
- name: Fetch Test Branches
run: git fetch origin test/javascript:test/javascript
- name: Run Benchmarks
run: cargo bench