Troubleshoot pages #22
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 | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Code checkout | |
| uses: actions/checkout@v4 | |
| - name: Install ancillary crates | |
| run: | | |
| cargo install cargo-llvm-cov | |
| cargo install cargo-warloc | |
| - name: Run tests | |
| run: make testcov | tee coverage.txt | |
| - name: Check style | |
| run: make style | |
| - name: Generate documentation | |
| run: make doc | |
| - name: Count lines of code | |
| run: make loc | tee warloc.txt | |
| - name: Compile release binary | |
| run: make release | |
| - name: Upload pages | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "target/doc/" | |
| - name: Upload executable | |
| uses: actions/upload-artifact@v4.6.2 | |
| with: | |
| name: mhrs | |
| path: | | |
| target/release/mhrs | |
| coverage.txt | |
| warloc.txt | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |