From 564865651d63ffff02d77d94b70b2bd1d71ac063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 15 Oct 2024 19:38:12 -0300 Subject: [PATCH] github: Fix CI by installing trunk and building frontend first --- .github/workflows/build.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69975d6e..e7de0601 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,13 +10,30 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + + - name: Install build dependencies - Rustup + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal --target x86_64-unknown-linux-musl wasm32-unknown-unknown -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: Check code style run: cargo fmt -- --check - - name: Build - run: cargo build --verbose - - name: Test - run: cargo test --verbose -- --nocapture + + - name: Install build dependencies - Cargo-Binstall + uses: cargo-bins/cargo-binstall@main + + - name: Install build dependencies - Trunk + run: cargo binstall -y trunk + + - name: Building frontend (wasm32) + working-directory: src/webpage + run: trunk build --release --locked --verbose + + - name: Building tests + run: SKIP_FRONTEND=1 cargo test --no-run --locked --verbose + + - name: Run Tests + run: SKIP_FRONTEND=1 cargo test --verbose -- --nocapture build: runs-on: ${{ matrix.os }}