diff --git a/.github/actions/prepare/action.yaml b/.github/actions/prepare/action.yaml new file mode 100644 index 0000000..9b08c3a --- /dev/null +++ b/.github/actions/prepare/action.yaml @@ -0,0 +1,25 @@ +name: 'Prepare' +description: 'Prepare action runner' +runs: + using: "composite" + steps: + - 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 40eefa2..11c7cf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,22 +11,8 @@ 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-${{ 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: actions/checkout@v4 + - uses: ./.github/actions/prepare/ - name: Build & run tests run: cargo test -p bevy_asset_loader - name: Build & run tests for derive package @@ -37,22 +23,8 @@ 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: 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 - name: Build & run tests for derive package @@ -63,22 +35,8 @@ 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: actions/checkout@v4 + - uses: ./.github/actions/prepare/ - name: Build & run tests progress tracking run: cargo test --features "progress_tracking" -p bevy_asset_loader full-test: @@ -87,43 +45,15 @@ 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: 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@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: actions/checkout@v4 + - uses: ./.github/actions/prepare/ - uses: taiki-e/install-action@v2 with: tool: cargo-hack