From f7b93a3bc1f5dfe3d9f966c70214d2490ecf07e5 Mon Sep 17 00:00:00 2001 From: Niklas Eicker Date: Sat, 13 Jul 2024 12:34:39 +0200 Subject: [PATCH 1/4] Try to get more space in GitHub runners --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40eefa2..5e2cb93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,9 @@ jobs: os: [windows-latest, ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: free up space in github runner + run: sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true; sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup /usr/lib/jvm || true; echo "some directories deleted" - uses: actions/cache@v3 with: path: | From 8ea63bef0e3026c9c55c7be5ef3c1fd2ebe3021e Mon Sep 17 00:00:00 2001 From: Niklas Eicker Date: Sat, 13 Jul 2024 14:08:43 +0200 Subject: [PATCH 2/4] Move steps to local action --- .github/actions/prepare/action.yaml | 26 +++++++++ .github/workflows/ci.yml | 88 ++--------------------------- 2 files changed, 32 insertions(+), 82 deletions(-) create mode 100644 .github/actions/prepare/action.yaml diff --git a/.github/actions/prepare/action.yaml b/.github/actions/prepare/action.yaml new file mode 100644 index 0000000..93d7aba --- /dev/null +++ b/.github/actions/prepare/action.yaml @@ -0,0 +1,26 @@ +name: 'Prepare' +description: 'Prepare action runner' +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + - name: free up space in github runner + run: sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true; sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup /usr/lib/jvm || true; echo "some directories deleted" + shell: bash + if: runner.os == 'linux' + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + - name: Install alsa and udev + shell: bash + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + if: runner.os == 'linux' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e2cb93..900b95c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,24 +11,7 @@ jobs: os: [windows-latest, ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - name: free up space in github runner - run: sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true; sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup /usr/lib/jvm || true; echo "some directories deleted" - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - 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' + - uses: ./.github/actions/prepare/ - name: Build & run tests run: cargo test -p bevy_asset_loader - name: Build & run tests for derive package @@ -39,22 +22,7 @@ jobs: os: [windows-latest, ubuntu-latest, macos-latest] 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-test-2d-3d-dynamic-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - 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' + - uses: ./.github/actions/prepare/ - name: Build & run tests for 2d, 3d, standard run: cargo test --features "2d, 3d, standard_dynamic_assets" -p bevy_asset_loader - name: Build & run tests for derive package @@ -65,22 +33,7 @@ jobs: os: [ windows-latest, ubuntu-latest, macos-latest ] 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-progress-tracking-test-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - 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' + - uses: ./.github/actions/prepare/ - name: Build & run tests progress tracking run: cargo test --features "progress_tracking" -p bevy_asset_loader full-test: @@ -89,43 +42,14 @@ jobs: os: [ windows-latest, ubuntu-latest, macos-latest ] 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-full-test-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - 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' + - uses: ./.github/actions/prepare/ - name: Build & run tests progress tracking and 2d,3d,dynamic run: cargo test --features "2d, 3d, standard_dynamic_assets, progress_tracking" -p bevy_asset_loader lint: 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-lint-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - components: rustfmt, clippy - - name: Install alsa and udev - run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + - uses: ./.github/actions/prepare/ + - uses: ./actions/prepare_runner - uses: taiki-e/install-action@v2 with: tool: cargo-hack From 738a25602c39c8336f355a857fdd270abece93f4 Mon Sep 17 00:00:00 2001 From: Niklas Eicker Date: Sat, 13 Jul 2024 14:11:25 +0200 Subject: [PATCH 3/4] Check out before startign local action --- .github/actions/prepare/action.yaml | 1 - .github/workflows/ci.yml | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/prepare/action.yaml b/.github/actions/prepare/action.yaml index 93d7aba..9b08c3a 100644 --- a/.github/actions/prepare/action.yaml +++ b/.github/actions/prepare/action.yaml @@ -3,7 +3,6 @@ description: 'Prepare action runner' runs: using: "composite" steps: - - uses: actions/checkout@v4 - name: free up space in github runner run: sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true; sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup /usr/lib/jvm || true; echo "some directories deleted" shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 900b95c..3431e03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: os: [windows-latest, ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: + - uses: actions/checkout@v4 - uses: ./.github/actions/prepare/ - name: Build & run tests run: cargo test -p bevy_asset_loader @@ -22,6 +23,7 @@ jobs: os: [windows-latest, ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: + - uses: actions/checkout@v4 - uses: ./.github/actions/prepare/ - name: Build & run tests for 2d, 3d, standard run: cargo test --features "2d, 3d, standard_dynamic_assets" -p bevy_asset_loader @@ -33,6 +35,7 @@ jobs: os: [ windows-latest, ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: + - uses: actions/checkout@v4 - uses: ./.github/actions/prepare/ - name: Build & run tests progress tracking run: cargo test --features "progress_tracking" -p bevy_asset_loader @@ -42,12 +45,14 @@ jobs: os: [ windows-latest, ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: + - uses: actions/checkout@v4 - uses: ./.github/actions/prepare/ - name: Build & run tests progress tracking and 2d,3d,dynamic run: cargo test --features "2d, 3d, standard_dynamic_assets, progress_tracking" -p bevy_asset_loader lint: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - uses: ./.github/actions/prepare/ - uses: ./actions/prepare_runner - uses: taiki-e/install-action@v2 From b6ba1200086f5018eed108270676962a221c83eb Mon Sep 17 00:00:00 2001 From: Niklas Eicker Date: Sat, 13 Jul 2024 14:23:52 +0200 Subject: [PATCH 4/4] Fix lint job --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3431e03..11c7cf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/prepare/ - - uses: ./actions/prepare_runner - uses: taiki-e/install-action@v2 with: tool: cargo-hack