Skip to content

Commit

Permalink
chore: update buck2 build order
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Oct 18, 2024
1 parent b154399 commit 28bfb86
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
44 changes: 19 additions & 25 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,46 @@ on:

jobs:
tests:
name: Execute via bats
name: execute via bats
runs-on: ubuntu-latest
timeout-minutes: 25
env:
BUCK2_CACHE_DIR: ${{ github.workspace }}/.buck-cache
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 12288
root-reserve-mb: 15360
temp-reserve-mb: 12288
remove-dotnet: "true"

- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v14
with:
extra-setup-flags: "--no-daemon"

- name: Enable magic Nix cache
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v8

- name: Cache Buck2 artifacts
uses: actions/cache@v3
with:
path: |
/home/runner/.buck2/cache
/home/runner/.buck2/buck-out
key: ${{ runner.os }}-buck2-cache-${{ hashFiles('**/BUCK2') }}
restore-keys: |
${{ runner.os }}-buck2-cache-
- name: Buck2 build
run: |
nix develop -c buck2 build \
//core/api //core/api-ws-server \
//core/api-keys //apps/dashboard //apps/consent //apps/pay //apps/admin-panel //apps/map //apps/voucher \
nix develop -c buck2 build //core/api \
//core/api-ws-server \
//apps/dashboard \
//apps/consent \
//apps/pay \
//apps/admin-panel \
//apps/map \
//apps/voucher \
//core/api-keys \
//core/notifications
- name: Run Bats setup suite script
run: |
bash bats/ci_setup_suite.bash
- name: Check Disk Usage
run: df -h

- name: Run Bats tests
- name: Run bats tests
run: |
nix develop -c bats -t bats/core/**
nix develop -c bats --setup-suite-file bats/ci_setup_suite.bash -t bats/core/**
- name: Rename Tilt log
if: always()
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ jobs:
tests:
name: execute via tilt
runs-on: ubuntu-latest
env:
BUCK2_CACHE_DIR: ${{ github.workspace }}/.buck-cache
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 12288
root-reserve-mb: 15360
temp-reserve-mb: 12288
remove-dotnet: "true"
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v14
Expand Down
4 changes: 2 additions & 2 deletions bats/ci_setup_suite.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ TILT_PID_FILE="${BATS_ROOT_DIR}/.tilt_pid"
setup_suite() {
background buck2 run //dev:up -- --bats=True > "${REPO_ROOT}/bats/.e2e-tilt.log"
echo $! > "$TILT_PID_FILE"
await_api_is_up
await_notifications_is_up
await_api_keys_is_up
await_api_is_up
await_pay_is_up
await_notifications_is_up
}

teardown_suite() {
Expand Down

0 comments on commit 28bfb86

Please sign in to comment.