Test #1042
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: Test | |
| on: | |
| # Run on every commit. | |
| push: | |
| # Run every day, at midnight UTC. | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: cargo fmt | |
| run: cargo fmt --all -- --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: use rust stable | |
| uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable | |
| with: | |
| components: clippy | |
| toolchain: stable | |
| - name: cache rust deps | |
| uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| - name: fetch katex deps | |
| run: make vendor/katex | |
| - name: cargo clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| machete: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: cache rust deps | |
| uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| - name: install cargo-machete | |
| run: cargo install cargo-machete | |
| - name: cargo machete | |
| run: cargo machete | |
| deny: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918 # v2.0.14 | |
| with: | |
| command: check licenses | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: use rust stable | |
| uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable | |
| with: | |
| toolchain: stable | |
| - name: cache rust deps | |
| uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| - name: install cargo-llvm-cov | |
| uses: taiki-e/install-action@7ec692fc37da04f8da31c22ba9f3b71ef267e650 # v2.62.24 | |
| with: | |
| tool: cargo-llvm-cov | |
| - name: fetch deps | |
| run: cargo fetch | |
| - name: run tests | |
| run: > | |
| cargo llvm-cov | |
| --all-features | |
| --workspace | |
| --lcov | |
| --ignore-filename-regex '(main|error|cli).rs' | |
| --output-path lcov.info | |
| env: | |
| RUST_LOG: debug | |
| - name: upload to codecov | |
| uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: lcov.info | |
| test: | |
| strategy: | |
| matrix: | |
| os: [macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: use rust stable | |
| uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable | |
| with: | |
| toolchain: stable | |
| - name: cache rust deps | |
| uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| - name: fetch deps | |
| run: cargo fetch | |
| - name: run tests | |
| run: cargo test --all-features --workspace | |
| env: | |
| RUST_LOG: debug | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: use rust stable | |
| uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable | |
| with: | |
| toolchain: stable | |
| - name: cache rust deps | |
| uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| - name: fetch deps | |
| run: cargo fetch | |
| - name: build | |
| run: cargo build --release | |
| validate-changelog: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: validate CHANGELOG.xml against schema | |
| uses: ChristophWurst/xmllint-action@7c54ff113fc0f6d4588a15cb4dfe31b6ecca5212 | |
| with: | |
| xml-file: CHANGELOG.xml | |
| xml-schema-file: CHANGELOG.xsd |