diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 455d0d32..12f0eedb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,9 +16,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install task command - run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin - - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.toolchain }} @@ -29,11 +26,24 @@ jobs: id: cache_cargo_tools uses: actions/cache@v3 with: - key: ${{ runner.os }}-cargo-install + key: ${{ runner.os }}-cargo-install--sqlx-sccache path: ~/.cargo/bin - name: Install cargo tools if: ${{ steps.cache_cargo_tools.outputs.cache-hit != 'true' }} - run: cargo install sqlx-cli --no-default-features --features native-tls,postgres - + run: | + cargo install sqlx-cli --no-default-features --features native-tls,postgres + cargo install sccache --locked + + - name: Setup fast build environment + run: | + apt install mold clang + echo '[build]' >> ~/.cargo/config.toml + echo 'rustc-wrapper = "/home/kanarus/.cargo/bin/sccache"' >> ~/.cargo/config.toml + echo '[target.x86_64-unknown-linux-gnu]' >> ~/.cargo/config.toml + echo 'linker = "clang"' >> ~/.cargo/config.toml + echo 'rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"]' >> ~/.cargo/config.toml + - name: Run tasks - run: task test check ${{ matrix.toolchain == 'nightly' && 'bench' || '' }} + run: | + sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin + task test check ${{ matrix.toolchain == 'nightly' && 'bench' || '' }}