mirror of
https://github.com/pseXperiments/freedit.git
synced 2026-01-10 12:17:54 -05:00
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 4 to 5. - [Release notes](https://github.com/actions/configure-pages/releases) - [Commits](https://github.com/actions/configure-pages/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/configure-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
109 lines
3.0 KiB
YAML
109 lines
3.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
|
|
jobs:
|
|
cargo:
|
|
name: Cargo test, clippy and doc
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
- os: macos-latest
|
|
target: x86_64-apple-darwin
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-gnu
|
|
permissions:
|
|
contents: write
|
|
security-events: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: stable
|
|
components: clippy, rustfmt
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Setup cache
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Cargo test
|
|
run: cargo test --target ${{ matrix.target }}
|
|
|
|
- name: Cargo fmt
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
run: cargo fmt -- --check
|
|
|
|
- name: typos check
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
run: |
|
|
cargo install typos-cli
|
|
typos
|
|
|
|
- name: Cargo clippy
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
run: cargo clippy --all-targets --all-features --message-format=json > clippy_result.json
|
|
continue-on-error: true
|
|
|
|
- name: Install clippy-sarif sarif-fmt (require cargo)
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
run: |
|
|
cargo install clippy-sarif sarif-fmt
|
|
cat clippy_result.json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
|
|
|
|
- name: Upload analysis results to GitHub
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
uses: github/codeql-action/upload-sarif@v3
|
|
with:
|
|
sarif_file: rust-clippy-results.sarif
|
|
wait-for-processing: true
|
|
|
|
- name: Cargo doc
|
|
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest'}}
|
|
run: |
|
|
cargo doc --no-deps --document-private-items
|
|
echo "<meta http-equiv='refresh' content='0; url=freedit'>" > target/doc/index.html
|
|
rm target/doc/.lock
|
|
|
|
- name: Upload artifact
|
|
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest'}}
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: 'target/doc'
|
|
|
|
Deploy:
|
|
needs: cargo
|
|
name: Deploy to GitHub Pages
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v5
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: 'github-pages'
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4 |