diff --git a/.github/workflows/e2e-test2.yml b/.github/workflows/e2e-test2.yml index 71114b9144d..c516b28e024 100644 --- a/.github/workflows/e2e-test2.yml +++ b/.github/workflows/e2e-test2.yml @@ -6,30 +6,26 @@ on: jobs: build: - name: parallel buck2 builds + name: clustered buck2 builds runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 strategy: matrix: - target: - - //core/api - - //core/api-ws-server - - //core/api-trigger - - //core/api-exporter - - //apps/dashboard - - //apps/consent - - //apps/pay - - //apps/admin-panel - - //apps/map - - //apps/voucher - - //core/api-keys - - //core/notifications - - //bats/helpers/callback:run - - //bats/helpers/subscriber:run - - //bats/helpers/totp:generate + cluster: + - name: core-apis + targets: "//core/api //core/api-ws-server //core/api-trigger //core/api-exporter" + - name: apps + targets: "//apps/dashboard //apps/consent //apps/pay //apps/admin-panel //apps/map //apps/voucher" + - name: core-services + targets: "//core/api-keys //core/notifications" + - name: bats-helpers + targets: "//bats/helpers/callback:run //bats/helpers/subscriber:run //bats/helpers/totp:generate" fail-fast: false steps: + - id: vars + run: echo "short_sha=${GITHUB_SHA:0:7}" >> $GITHUB_ENV + - uses: actions/checkout@v4 - name: Install Nix @@ -38,9 +34,9 @@ jobs: - name: Run the Magic Nix Cache uses: DeterminateSystems/magic-nix-cache-action@v8 - - name: Build + - name: Build cluster run: | - nix develop -c buck2 build ${{ matrix.target }} + nix develop -c buck2 build ${{ matrix.cluster.targets }} - uses: actions/cache/save@v4 with: @@ -53,7 +49,8 @@ jobs: target .buckd buck-out/cache - key: buck2-${{ runner.os }}-${{ matrix.target }} + key: b2-${{ matrix.cluster.name }}-${{ env.short_sha }} + enableCrossOsArchive: true tests: name: execute via bats @@ -62,6 +59,16 @@ jobs: needs: build steps: + - id: vars + run: echo "short_sha=${GITHUB_SHA:0:7}" >> $GITHUB_ENV + + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + root-reserve-mb: 15360 + temp-reserve-mb: 12288 + remove-dotnet: "true" + - uses: actions/checkout@v4 - name: Install Nix @@ -81,25 +88,27 @@ jobs: target .buckd buck-out/cache - key: buck2-${{ runner.os }}- + key: | + b2-core-apis-${{ env.short_sha }} + b2-apps-${{ env.short_sha }} + b2-core-services-${{ env.short_sha }} + b2-bats-helpers-${{ env.short_sha }} + restore-keys: | + b2-core-apis- + b2-apps- + b2-core-services- + b2-bats-helpers- + fail-on-cache-miss: true - name: Run bats tests run: | - nix develop -c buck2 build //core/api \ - //core/api-ws-server \ - //core/api-trigger \ - //core/api-exporter \ - //apps/dashboard \ - //apps/consent \ - //apps/pay \ - //apps/admin-panel \ - //apps/map \ - //apps/voucher \ - //core/api-keys \ - //core/notifications \ - //bats/helpers/callback:run \ - //bats/helpers/subscriber:run \ - //bats/helpers/totp:generate + # Build all targets again (should be fast with cache) + nix develop -c buck2 build \ + //core/api //core/api-ws-server //core/api-trigger //core/api-exporter \ + //apps/dashboard //apps/consent //apps/pay //apps/admin-panel //apps/map //apps/voucher \ + //core/api-keys //core/notifications \ + //bats/helpers/callback:run //bats/helpers/subscriber:run //bats/helpers/totp:generate + nix develop -c bats --setup-suite-file bats/ci_setup_suite.bash -t bats/core/** - name: Rename Tilt log