Optimize CI runtime by using a better cache

This commit is contained in:
Maximilian Ammann 2022-04-22 22:23:49 +02:00
parent 729287cf07
commit b18f823f43
9 changed files with 25 additions and 36 deletions

View File

@ -4,10 +4,11 @@ description: Build for android
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: ./.github/actions/rust-cache - uses: extractions/setup-just@v1
- name: Install just - name: Install nightly toolchain
shell: bash shell: bash
run: cargo install just run: just nightly-toolchain
- uses: Swatinem/rust-cache@v1
- name: Build - name: Build
shell: bash shell: bash
run: just build-apk run: just build-apk

View File

@ -4,10 +4,9 @@ description: Check
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: ./.github/actions/rust-cache - uses: extractions/setup-just@v1
- name: Install just - uses: actions-rs/toolchain@v1
shell: bash - uses: Swatinem/rust-cache@v1
run: cargo install just
- name: Format - name: Format
shell: bash shell: bash
run: just fmt-check run: just fmt-check

View File

@ -4,7 +4,8 @@ description: Build for desktop
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: ./.github/actions/rust-cache - uses: actions-rs/toolchain@v1
- uses: Swatinem/rust-cache@v1
- name: Install Dependencies - name: Install Dependencies
shell: bash shell: bash
run: sudo apt-get install -y libwayland-dev libxkbcommon-dev # Required for winit run: sudo apt-get install -y libwayland-dev libxkbcommon-dev # Required for winit

View File

@ -4,7 +4,8 @@ description: Build documentation
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: ./.github/actions/rust-cache - uses: actions-rs/toolchain@v1
- uses: Swatinem/rust-cache@v1
- name: Install mdbook - name: Install mdbook
shell: bash shell: bash
run: | run: |

View File

@ -1,15 +0,0 @@
name: rust-cache
description: Cache for rust
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates*
key: 1-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}

View File

@ -4,10 +4,11 @@ description: Build for webgl
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: ./.github/actions/rust-cache - uses: extractions/setup-just@v1
- name: Install just - name: Install nightly toolchain
shell: bash shell: bash
run: cargo install just run: just nightly-toolchain
- uses: Swatinem/rust-cache@v1
- name: Build - name: Build
shell: bash shell: bash
run: just webpack-webgl-production run: just webpack-webgl-production

View File

@ -4,10 +4,11 @@ description: Build for webgpu
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: ./.github/actions/rust-cache - uses: extractions/setup-just@v1
- name: Install just - name: Install nightly toolchain
shell: bash shell: bash
run: cargo install just run: just nightly-toolchain
- uses: Swatinem/rust-cache@v1
- name: Build - name: Build
shell: bash shell: bash
run: just webpack-production run: just webpack-production

View File

@ -15,9 +15,9 @@ jobs:
shell: bash shell: bash
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: - uses: extractions/setup-just@v1
submodules: 'recursive' - uses: actions-rs/toolchain@v1
- uses: ./.github/actions/rust-cache - uses: Swatinem/rust-cache@v1
- name: Build xcframework - name: Build xcframework
run: just xcodebuild-xcframework run: just xcodebuild-xcframework
- name: Build Example - name: Build Example

View File

@ -2,7 +2,7 @@
# ^ A shebang isn't required, but allows a justfile to be executed # ^ A shebang isn't required, but allows a justfile to be executed
# like a script, with `./justfile test`, for example. # like a script, with `./justfile test`, for example.
export RUSTUP_TOOLCHAIN := "nightly-2022-04-04-x86_64-unknown-linux-gnu" export NIGHTLY_TOOLCHAIN := "nightly-2022-04-04-x86_64-unknown-linux-gnu"
test: test:
cargo test cargo test
@ -23,8 +23,8 @@ fmt-check: install-rustfmt
cargo fmt --all -- --check cargo fmt --all -- --check
nightly-toolchain: nightly-toolchain:
rustup install $RUSTUP_TOOLCHAIN rustup install $NIGHTLY_TOOLCHAIN
rustup component add rust-src --toolchain $RUSTUP_TOOLCHAIN rustup component add rust-src --toolchain $NIGHTLY_TOOLCHAIN
webpack-webgl-production: nightly-toolchain webpack-webgl-production: nightly-toolchain
cd web/web && npm install && npm run webgl-production-build cd web/web && npm install && npm run webgl-production-build