Skip to content

Add astro support #1130

Add astro support

Add astro support #1130

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:
- 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
- name: Main Cache
uses: actions/cache@v4
with:
path: |
~/.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 }}
# TODO: Make it easier to use a new cache when updating bin versions
- name: Bin Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
key: ${{ runner.os }}-cargo-bin
- name: Install tarpaulin
run: cargo install [email protected]
# NOTE: The last step fails if tarpaulin is already installed
continue-on-error: true
- name: Generate Coverage
run: cargo tarpaulin --verbose ${{ matrix.feature-flags }} --workspace --timeout 120 --out xml
- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
flags: ${{ matrix.os }},${{ matrix.feature-flags }}
token: ${{ secrets.CODECOV_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
needs:
- check-languages-file
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
needs:
- lint
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