test(apps): fix dashboard/voucher/consent tests #31
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
name: "E2e test" | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
name: clustered buck2 builds | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
cluster: | |
- name: core-apis | |
targets: "//:node_modules //core/api //core/api-ws-server //core/api-trigger //core/api-exporter" | |
fail-fast: false | |
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 | |
uses: DeterminateSystems/nix-installer-action@v14 | |
- name: Run the Magic Nix Cache | |
uses: DeterminateSystems/magic-nix-cache-action@v8 | |
- name: Create cache directories | |
run: | | |
mkdir -p ~/.buck2 ~/.cache/buck2 buck-out/cache buck-out/v2 | |
# Try to restore cache before building | |
- uses: actions/cache/restore@v4 | |
id: cache-restore | |
with: | |
path: | | |
~/.buck2 | |
~/.cache/buck2 | |
buck-out | |
.buck-cache | |
.buckd | |
prebuilt | |
installed | |
target | |
key: b2-${{ matrix.cluster.name }}-${{ env.short_sha }} | |
restore-keys: | | |
b2-${{ matrix.cluster.name }}- | |
- name: Build cluster | |
run: | | |
nix develop -c buck2 build ${{ matrix.cluster.targets }} | |
- name: Debug cache content | |
run: | | |
echo "Buck cache structure:" | |
find buck-out -type d | |
echo "Buck output size by directory:" | |
du -sh buck-out/* | |
- uses: actions/cache/save@v4 | |
with: | |
path: | | |
~/.buck2 | |
~/.cache/buck2 | |
buck-out | |
.buck-cache | |
.buckd | |
prebuilt | |
installed | |
target | |
key: b2-${{ matrix.cluster.name }}-${{ env.short_sha }} | |
enableCrossOsArchive: true | |
tests: | |
name: execute via bats | |
runs-on: ubuntu-latest | |
timeout-minutes: 25 | |
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 | |
uses: DeterminateSystems/nix-installer-action@v14 | |
- name: Run the Magic Nix Cache | |
uses: DeterminateSystems/magic-nix-cache-action@v8 | |
- name: Create cache directories | |
run: | | |
mkdir -p ~/.buck2 ~/.cache/buck2 buck-out/cache buck-out/v2 | |
# Modified cache restoration strategy | |
- name: Restore all cluster caches | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.buck2 | |
~/.cache/buck2 | |
buck-out | |
.buck-cache | |
.buckd | |
prebuilt | |
installed | |
target | |
key: | | |
b2-core-apis-${{ env.short_sha }} | |
restore-keys: | | |
b2-core-apis- | |
fail-on-cache-miss: true | |
- name: Debug restored cache | |
run: | | |
echo "Cache directory structure:" | |
find buck-out -type d | |
echo "Cache sizes by directory:" | |
du -sh buck-out/* | |
- name: Run bats tests | |
run: | | |
echo "Buck build status before tests:" | |
nix develop -c buck2 build --show-output \ | |
//:node_modules //core/api //core/api-ws-server //core/api-trigger //core/api-exporter | |
- 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 |