fix: make cargo publish work by pre-building frontend #7
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Install frontend dependencies | |
| working-directory: tracing-web-console/frontend | |
| run: pnpm install --frozen-lockfile | |
| - name: Build frontend | |
| working-directory: tracing-web-console/frontend | |
| run: pnpm build | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@1.91 | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Build | |
| run: cargo build --all-targets | |
| - name: Run tests | |
| run: cargo test --all-targets | |
| frontend-lint: | |
| name: Frontend Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Install dependencies | |
| working-directory: tracing-web-console/frontend | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check | |
| working-directory: tracing-web-console/frontend | |
| run: pnpm tsc --noEmit | |
| - name: Lint | |
| working-directory: tracing-web-console/frontend | |
| run: pnpm lint |