Update CI #4
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: Build-Test CI | |
| on: | |
| push: | |
| branches: ["**"] # Trigger on all branches | |
| pull_request: | |
| branches: ["**"] # Trigger on all PRs | |
| permissions: | |
| contents: read # Minimally scoped permissions for GITHUB_TOKEN | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies (Typst, Cargo, Tools) | |
| run: | | |
| sudo snap install typst | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
| source $HOME/.cargo/env | |
| cargo install --locked --git https://github.com/typst/package-check.git --rev bb794efed86cb8dc29dd2b60700fc369e847acbb | |
| cargo install --locked tytanic@0.2.2 | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Lint and build project (Install package to local Typst) | |
| run: | | |
| make lint | |
| make install | |
| - name: Run tests | |
| run: | | |
| make test | |
| - name: Clean up (Uninstall package from local Typst) | |
| run: | | |
| make uninstall |