-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: parallelize e2e builds in gh action
- Loading branch information
Showing
1 changed file
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: "E2e test" | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
name: parallel buck2 builds | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 25 | ||
strategy: | ||
matrix: | ||
target: | ||
- //core/api | ||
- //core/api-ws-server | ||
- //apps/dashboard | ||
- //apps/consent | ||
- //apps/pay | ||
- //apps/admin-panel | ||
- //apps/map | ||
- //apps/voucher | ||
- //core/api-keys | ||
- //core/notifications | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Maximize build space | ||
uses: easimon/maximize-build-space@master | ||
with: | ||
root-reserve-mb: 15360 | ||
temp-reserve-mb: 12288 | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@v14 | ||
|
||
- name: Run the Magic Nix Cache | ||
uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
|
||
# More comprehensive Buck2 cache configuration | ||
- name: Restore Buck2 cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
~/.buck2 | ||
buck-out | ||
.buck-cache | ||
prebuilt | ||
installed | ||
target | ||
key: buck2-cache-${{ github.sha }} | ||
restore-keys: | | ||
buck2-cache- | ||
- name: Build ${{ matrix.target }} | ||
run: | | ||
# Initialize Buck2 daemon if needed | ||
nix develop -c buck2 daemon | ||
# Perform the build | ||
nix develop -c buck2 build ${{ matrix.target }} | ||
- name: Save Buck2 cache | ||
if: always() | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
~/.buck2 | ||
buck-out | ||
.buck-cache | ||
prebuilt | ||
installed | ||
target | ||
key: buck2-cache-${{ github.sha }} | ||
|
||
tests: | ||
needs: build | ||
name: execute via bats | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 25 | ||
steps: | ||
- name: Maximize build space | ||
uses: easimon/maximize-build-space@master | ||
with: | ||
root-reserve-mb: 15360 | ||
temp-reserve-mb: 12288 | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@v14 | ||
|
||
- name: Run the Magic Nix Cache | ||
uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
|
||
# Use the same comprehensive Buck2 cache configuration | ||
- name: Restore Buck2 cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
~/.buck2 | ||
buck-out | ||
.buck-cache | ||
prebuilt | ||
installed | ||
target | ||
key: buck2-cache-${{ github.sha }} | ||
restore-keys: | | ||
buck2-cache- | ||
- name: Initialize Buck2 daemon | ||
run: nix develop -c buck2 daemon | ||
|
||
- name: Run bats tests | ||
run: | | ||
nix develop -c bats --setup-suite-file bats/ci_setup_suite.bash -t bats/core/** | ||
- name: Rename Tilt log | ||
if: always() | ||
run: mv bats/.e2e-tilt.log bats/e2e-tilt.log | ||
|
||
- name: Upload Tilt log | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Tilt log | ||
path: bats/e2e-tilt.log |