diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6050db4..983be59a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: pull_request: push: +env: + CARGO_TERM_COLOR: always + NIGHTLY_TOOLCHAIN: nightly-2023-03-01 + jobs: test-native: strategy: @@ -12,19 +16,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-build-nightly-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 - override: true + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} + - name: Cache Cargo build files + uses: Leafwing-Studios/cargo-cache@v1 - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev if: runner.os == 'linux' @@ -33,26 +29,18 @@ jobs: if: runner.os == 'macos' - name: Install llvm tools run: cargo install -f cargo-binutils && rustup component add llvm-tools-preview - if : runner.os == 'windows' + if: runner.os == 'windows' - name: Build & run tests for native run: cargo test test-native-docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ubuntu-latest-cargo-build-nightly-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 - override: true + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} + - name: Cache Cargo build files + uses: Leafwing-Studios/cargo-cache@v1 - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - name: Run doc tests @@ -61,25 +49,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - uses: dtolnay/rust-toolchain@master with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ubuntu-latest-cargo-build-nightly-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly-2023-03-01 - override: true + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} + - name: Cache Cargo build files + uses: Leafwing-Studios/cargo-cache@v1 - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev - name: Install trunk uses: jetli/trunk-action@v0.1.0 with: - version: 'v0.16.0' + version: "v0.16.0" - name: Add wasm target run: | rustup target add wasm32-unknown-unknown @@ -89,20 +69,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ubuntu-latest-cargo-build-nightly-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} components: rustfmt, clippy - override: true + - name: Cache Cargo build files + uses: Leafwing-Studios/cargo-cache@v1 - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - name: Check format diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml index 3558b70d..7fe1b129 100644 --- a/.github/workflows/deploy-web.yml +++ b/.github/workflows/deploy-web.yml @@ -3,6 +3,10 @@ name: deploy-github-page on: workflow_dispatch: +env: + CARGO_TERM_COLOR: always + NIGHTLY_TOOLCHAIN: nightly-2023-03-01 + jobs: build-web: runs-on: ubuntu-latest @@ -11,16 +15,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Install rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 - override: true + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} - name: Install Dependencies run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev - name: Install trunk uses: jetli/trunk-action@v0.1.0 with: - version: 'v0.16.0' + version: "v0.16.0" - name: Add wasm target run: | rustup target add wasm32-unknown-unknown diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2a8cc0dd..146619c7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,6 +11,9 @@ env: GAME_EXECUTABLE_NAME: foxtrot GAME_OSX_APP_NAME: Foxtrot + CARGO_TERM_COLOR: always + NIGHTLY_TOOLCHAIN: nightly-2023-03-01 + permissions: contents: write @@ -19,8 +22,8 @@ jobs: runs-on: macos-latest env: - # macOS 11.0 Big Sur is the first version of macOS to support universal binaries - MACOSX_DEPLOYMENT_TARGET: 11.0 + # macOS 11.0 Big Sur is the first version of macOS to support universal binaries + MACOSX_DEPLOYMENT_TARGET: 11.0 steps: - name: Get tag id: tag @@ -36,9 +39,9 @@ jobs: run: | rm build.rs - name: Install rust toolchain for Apple Silicon - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} target: aarch64-apple-darwin override: true - name: Install zld @@ -48,9 +51,9 @@ jobs: run: | SDKROOT=$(xcrun -sdk macosx --show-sdk-path) RUSTFLAGS="-C link-arg=-fuse-ld=/usr/local/bin/zld -Z share-generics=y" cargo build --release --no-default-features --features native --target=aarch64-apple-darwin - name: Install rust toolchain for Apple x86 - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} target: x86_64-apple-darwin override: true - name: Build release for x86 Apple @@ -93,10 +96,9 @@ jobs: run: | git lfs pull - name: Install rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 - override: true + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} - name: Install Dependencies run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev - name: Build release @@ -134,10 +136,9 @@ jobs: run: | git lfs pull - name: Install rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 - override: true + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} - name: Install dotnet uses: actions/setup-dotnet@v3 with: @@ -167,11 +168,11 @@ jobs: - name: Upload installer uses: svenstaro/upload-release-action@v2 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: installer/en-US/installer.msi - asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ steps.tag.outputs.tag }}_windows.msi - tag: ${{ github.ref }} - overwrite: true + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: installer/en-US/installer.msi + asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ steps.tag.outputs.tag }}_windows.msi + tag: ${{ github.ref }} + overwrite: true build-web: runs-on: ubuntu-latest @@ -184,16 +185,15 @@ jobs: run: | git lfs pull - name: Install rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-03-01 - override: true + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} - name: Install Dependencies run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev - name: Install trunk uses: jetli/trunk-action@v0.1.0 with: - version: 'v0.16.0' + version: "v0.16.0" - name: Add wasm target run: | rustup target add wasm32-unknown-unknown