ci: use patches for shuttle/main on develop branch #250
Workflow file for this run
This file contains 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 | |
on: | |
push: | |
branches: [ "main", "develop" ] | |
pull_request: | |
branches: [ "main", "develop" ] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check-templates: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-binstall | |
- run: cargo binstall -y rust-script@0.34.0 | |
- run: rust-script _scripts/check-templates.rs | |
fmt-clippy: | |
strategy: | |
matrix: | |
from-to: ["a q", "q zzz"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Clone the Shuttle main repository | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
run: git clone --depth 1 https://github.com/shuttle-hq/shuttle.git | |
- name: Apply patches from Shuttle | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
run: ./shuttle/scripts/apply-patches.sh .cargo/config.toml "$(pwd)/shuttle" | |
- name: Install sccache | |
run: | | |
SCCACHE_VERSION='v0.7.7' | |
curl -L https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz \ | |
| tar -xOz sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache \ | |
> /home/runner/.cargo/bin/sccache \ | |
&& chmod +x /home/runner/.cargo/bin/sccache | |
# bevy dependency | |
- run: sudo apt install -y libasound2-dev libudev-dev | |
- name: Check formatting and Clippy | |
shell: bash | |
run: ./ci.sh ${{ matrix.from-to }} | |
env: | |
RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache | |
CARGO_TARGET_DIR: /tmp/target | |
- name: Show sccache stats | |
run: /home/runner/.cargo/bin/sccache --show-stats |