diff options
author | Thomas Linford <tlinford@users.noreply.github.com> | 2023-05-03 21:16:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-03 21:16:38 +0200 |
commit | f598ca373829c99c6e2b2c6064047ed07c139ff7 (patch) | |
tree | 3f409b9218d9eaec5f7ce087408f75c29914fb07 /.github/workflows | |
parent | ecd63a100b9d927d78c64cda73bae5ec16cac419 (diff) |
improve build/ci times (#2396)
- avoid building all workspace crates with `cargo x build` (only plugins and main binary)
- only set the target triple in tests for plugins
- add new profile for `cargo x run` to build with optimized dependencies => FAST plugins when developing (thanks [Bevy Book](https://bevyengine.org/learn/book/getting-started/setup/#compile-with-performance-optimizations) for the idea)
- use https://github.com/Swatinem/rust-cache to avoid rebuilding dependencies every time in ci
- split `Build & Test` job into two so they run in parallel
- hopefully improve the flaky tests situation, this also makes the e2e tests run much faster (some tests produced correct snapshots but had some logic errors causing them to loop for much longer than necessary). Add some output to the tests so it is easier to see if something goes wrong.
- remove verbose build output from e2e test build
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/e2e.yml | 8 | ||||
-rw-r--r-- | .github/workflows/rust.yml | 80 |
2 files changed, 44 insertions, 44 deletions
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 43f6d4a88..76e38d3cf 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -10,7 +10,7 @@ env: CARGO_TERM_COLOR: always jobs: - test: + test-e2e: name: Build generic binary and run tests on it runs-on: ubuntu-latest environment: cachix @@ -37,8 +37,10 @@ jobs: - name: Add musl target run: rustup target add x86_64-unknown-linux-musl #run: cargo install --debug cargo-make - - name: Build asset - run: cargo xtask ci e2e --build + - uses: Swatinem/rust-cache@v2 + # ensure the target folder exists, otherwise fixtures won't be in the right place + - name: Create target folder + run: mkdir -p ${{ github.workspace }}/target # we copy this manually into the target folder instead of mounting it because # github actions creates the service first, and if it has a mount that is part # of your yet unchecked out code, you cannot checkout the code after the mount diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 06db6d82d..cc0ee2ab9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,71 +2,69 @@ name: Rust on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: CARGO_TERM_COLOR: always jobs: build: - name: Build & Test + name: Build strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest ] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Add WASM target - run: rustup target add wasm32-wasi - - name: Build - run: cargo xtask build - - name: Test - run: cargo xtask test + - uses: actions/checkout@v3 + - name: Setup toolchain + run: rustup show + - uses: Swatinem/rust-cache@v2 + - name: Build + run: cargo xtask build + + test: + name: Test + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + - name: Setup toolchain + run: rustup show + - uses: Swatinem/rust-cache@v2 + - name: Test + run: cargo xtask test format: name: Check Formatting runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Check Format - run: cargo xtask format --check + - uses: actions/checkout@v3 + - name: Setup toolchain + run: rustup show + - name: Check Format + run: cargo xtask format --check clippy: name: Check Clippy Lints runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Check clippy lints - run: cargo xtask clippy + - uses: actions/checkout@v3 + - name: Setup toolchain + run: rustup show + - uses: Swatinem/rust-cache@v2 + - name: Check clippy lints + run: cargo xtask clippy |