diff --git a/.github/actions/setup-rust/action.yaml b/.github/actions/setup-rust/action.yaml new file mode 100644 index 0000000..672808c --- /dev/null +++ b/.github/actions/setup-rust/action.yaml @@ -0,0 +1,26 @@ +name: "Setup Rust build" +description: "Common steps before running a Rust/Cargo task" + +runs: + using: "composite" + steps: + - name: Setup CI caching + uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} + + - name: Install additional tools (Mac) + if: runner.os == 'macOS' + shell: bash + run: brew install just coreutils zig + + - name: Install additional tools (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + sudo snap install --edge --classic just + sudo snap install zig --classic --beta && zig version + + - name: Setup Rust and Cargo plugins + shell: bash + run: just setup-ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2737b2f..d857420 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,16 +30,8 @@ jobs: - name: Project Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Setup CI caching - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - save-if: ${{ github.ref == 'refs/heads/main' }} - - - name: Install additional tools - run: sudo snap install --edge --classic just - - - name: Setup Rust and Cargo plugins - run: just setup-ci + - name: Setup CI + uses: ./.github/actions/setup-rust - name: Check project for errors run: just checks @@ -55,18 +47,8 @@ jobs: - name: Project Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Setup CI caching - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - save-if: ${{ github.ref == 'refs/heads/main' }} - - - name: Install additional tools (Linux) - run: | - sudo snap install --edge --classic just - sudo snap install zig --classic --beta && zig version - - - name: Setup Rust and Cargo plugins - run: just setup-ci + - name: Setup CI + uses: ./.github/actions/setup-rust - name: Cross-compilation against some targets run: just e2e ${{ matrix.resource }} @@ -82,23 +64,8 @@ jobs: - name: Project Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Setup CI caching - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - save-if: ${{ github.ref == 'refs/heads/main' }} - - - name: Install additional tools (Mac) - if: runner.os == 'macOS' - run: brew install just coreutils zig - - - name: Install additional tools (Linux) - if: runner.os == 'Linux' - run: | - sudo snap install --edge --classic just - sudo snap install zig --classic --beta && zig version - - - name: Setup Rust and Cargo plugins - run: just setup-ci + - name: Setup CI + uses: ./.github/actions/setup-rust - name: Cross-compilation against some targets run: just flexible-build @@ -117,16 +84,8 @@ jobs: - name: Project Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Setup CI caching - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - save-if: ${{ github.ref == 'refs/heads/main' }} - - - name: Install additional tools - run: sudo snap install --edge --classic just - - - name: Setup Rust and Cargo plugins - run: just setup-ci + - name: Setup CI + uses: ./.github/actions/setup-rust - name: Check MSRV run: just msrv-check diff --git a/e2e/disk.bats b/e2e/disk.bats index 928fc05..09dd99f 100644 --- a/e2e/disk.bats +++ b/e2e/disk.bats @@ -55,11 +55,3 @@ [ ! -d $HOME/aaw/build ] [ ! -d $HOME/aaw/.gradle ] } - -@test "should detect usages of ram" { - run $HOME/aaw/gradlew tasks -q -p $HOME/aaw - run gradle-wiper ram evaluate - - [[ "$output" == *"Total resources (RAM memory)"* ]] - [ "$status" -eq 0 ] -}