Skip to content

ci: do not track blend and glb files as text #17

ci: do not track blend and glb files as text

ci: do not track blend and glb files as text #17

Workflow file for this run

name: cicd
on:
push:
branches: "**"
pull_request:
branches: "**"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: cache
uses: Swatinem/rust-cache@v2
- name: install alsa and udev (linux)
if: runner.os == 'linux'
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: test
run: cargo test --workspace --all-features
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- name: cache
uses: Swatinem/rust-cache@v2
- name: install alsa and udev (linux)
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: format
run: cargo fmt --all -- --check
mdbook:
runs-on: ubuntu-latest
needs: [test, lint]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: setup mdbook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: "latest"
- name: build mdbook
run: mdbook build
- name: setup pages
uses: actions/configure-pages@v4
if: |
github.ref_name == github.event.repository.default_branch &&
github.event_name != 'pull_request'
- name: upload artifact
uses: actions/upload-pages-artifact@v3
if: |
github.ref_name == github.event.repository.default_branch &&
github.event_name != 'pull_request'
with:
path: "target/book"
deploy-github-pages:
name: deploy github pages
if: |
github.ref_name == github.event.repository.default_branch &&
github.event_name != 'pull_request'
runs-on: ubuntu-latest
needs: [mdbook]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: deploy to github pages
uses: actions/deploy-pages@v4
id: deployment
release:
if: |
github.ref_name == github.event.repository.default_branch &&
github.event_name != 'pull_request'
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
lfs: true
- name: checkout lfs
run: git lfs pull
- name: rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: cache
uses: Swatinem/rust-cache@v2
- name: install alsa and udev (linux)
if: runner.os == 'linux'
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
ignore-unpublished-changes: true