improvement: remove .as_str() methods in StaticAsset constructor, in … #4
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Build tests | |
run: cargo test --no-run | |
- name: Run tests | |
run: cargo test | |
fmt: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt | |
- name: Enforce formatting | |
run: cargo fmt --check | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: clippy | |
- name: Linting | |
run: cargo clippy | |
coverage: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: llvm-tools-preview | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
- name: Generate report | |
run: cargo llvm-cov report --html --output-dir coverage | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "Coverage report" | |
path: coverage/ | |
# Verify that the `server_sdk` crate is up-to-date. | |
is-up-to-date: | |
name: Freshness | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust stable toolchain | |
uses: actions-rust-lang/[email protected] | |
with: | |
rustflags: "" | |
cache: false | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-directories: "~/.pavex" | |
- name: Install cargo-binstall | |
uses: cargo-bins/cargo-binstall@main | |
- name: Install cargo-px | |
run: cargo binstall -y --force --github-token=${{ secrets.GITHUB_TOKEN }} cargo-px --version="^0.1.15" | |
- name: Install and setup pavex | |
run: | | |
curl --proto '=https' --tlsv1.2 -LsSf https://pavex.dev/install.sh | sh | |
pavex self setup --skip-activation | |
- name: Verify freshness | |
run: | | |
cargo px verify-freshness | |
docker: | |
name: Docker image | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/build-push-action@v5 | |
with: | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |