WIP: rejuvenate project #23
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: Rust | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run tests | |
| run: cargo test --workspace --verbose | |
| docs: | |
| # main only | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build docs | |
| run: cargo doc --no-deps --all-features --workspace | |
| - name: Add redirect | |
| run: echo '<html><head><meta http-equiv="refresh" content="0; URL=./twamp_rs" /></head></html>' > target/doc/index.html | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./target/doc | |
| deploy: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.output.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: docs | |
| steps: | |
| - name: Deploy to Github Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |