chore: add a github page with coverage stats & shields.io coverage ba… #1212
This file contains hidden or 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
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: ['main', 'v*'] | |
| permissions: {} | |
| jobs: | |
| CI: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| toolchain: ['stable', 'nightly'] | |
| task: ['check', 'test:core', 'test:other', 'bench:dryrun'] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup mold | |
| run: | | |
| sudo apt install mold clang | |
| echo '[target.x86_64-unknown-linux-gnu]' >> $HOME/.cargo/config.toml | |
| echo 'linker = "clang"' >> $HOME/.cargo/config.toml | |
| echo 'rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"]' >> $HOME/.cargo/config.toml | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: latest | |
| - run: npm install -g wrangler | |
| - name: Setup Rust toolchain | |
| run: | | |
| rustup update | |
| rustup default ${{ matrix.toolchain }} | |
| rustup target add wasm32-unknown-unknown | |
| rustup component add rustfmt clippy | |
| - name: Cache cargo bin | |
| id: cache_cargo_bin | |
| uses: actions/cache@v4 | |
| with: | |
| key: ${{ runner.os }}-cargo-bin | |
| path: ~/.cargo/bin | |
| - name: Install cargo commands | |
| if: ${{ steps.cache_cargo_bin.outputs.cache-hit != 'true' }} | |
| run: | | |
| cargo install sqlx-cli --no-default-features --features native-tls,postgres | |
| cargo install sccache --locked | |
| cargo install wasm-pack worker-build | |
| - name: Setup sccache | |
| run: | | |
| echo '[build]' >> $HOME/.cargo/config.toml | |
| echo "rustc-wrapper = \"$HOME/.cargo/bin/sccache\"" >> $HOME/.cargo/config.toml | |
| - name: Cache sccahe dir | |
| id: cahce_sccahe_dir | |
| # cache sccache directory after the most large task | |
| # in order to maximize cache hit | |
| if: ${{ matrix.task == 'test:other' }} | |
| uses: actions/cache@v4 | |
| with: | |
| key: ${{ runner.os }}-sccahe-dir | |
| path: ~/.cache/sccache | |
| - name: Run tasks | |
| if: ${{ !(matrix.toolchain == 'nightly' && matrix.task == 'check') }} # WORKAROUND for https://github.com/rust-lang/rust/issues/149692 | |
| run: | | |
| sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin | |
| task ${{ matrix.task }} |