From 8fb314c9230ba972453b5ebf292214d10f076468 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Mon, 21 Oct 2024 09:49:16 -0700 Subject: [PATCH] ci: make preflight tests available in any regions (#4013) This could be used to test larger changes, and eventually from CI someday. --- .github/workflows/preflight.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/preflight.yml b/.github/workflows/preflight.yml index ac4db21737..95f0ff498d 100644 --- a/.github/workflows/preflight.yml +++ b/.github/workflows/preflight.yml @@ -3,10 +3,10 @@ name: Preflight Tests on: workflow_dispatch: inputs: - reason: - description: Brief reason for running this workflow manually + region: + description: Region required: false - default: User initiated run + default: ord type: string workflow_call: @@ -17,7 +17,6 @@ jobs: strategy: fail-fast: false matrix: - vm_size: [""] parallelism: [20] index: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] steps: @@ -33,22 +32,24 @@ jobs: run: | curl -sfL https://raw.githubusercontent.com/Songmu/gotesplit/v0.2.1/install.sh | sh -s echo "FLY_PREFLIGHT_TEST_APP_PREFIX=pf-gha-$(openssl rand -hex 4)" >> "$GITHUB_ENV" + # If this workflow is triggered by code changes (eg PRs), download the binary to save time. - uses: actions/download-artifact@v4 with: name: flyctl path: master-build + continue-on-error: true + # But if this is a manual run, build the binary first. + - run: make - name: Run preflight tests id: preflight env: FLY_PREFLIGHT_TEST_ACCESS_TOKEN: ${{ secrets.FLYCTL_PREFLIGHT_CI_FLY_API_TOKEN }} FLY_PREFLIGHT_TEST_FLY_ORG: flyctl-ci-preflight - # This VM size is only available in ORD. - FLY_PREFLIGHT_TEST_FLY_REGIONS: ord + FLY_PREFLIGHT_TEST_FLY_REGIONS: ${{ inputs.region }} FLY_PREFLIGHT_TEST_NO_PRINT_HISTORY_ON_FAIL: "true" FLY_FORCE_TRACE: "true" - FLY_PREFLIGHT_TEST_VM_SIZE: ${{ matrix.vm_size }} run: | - mv master-build/flyctl bin/flyctl + (test -e master-build/flyctl) && mv master-build/flyctl bin/flyctl chmod +x bin/flyctl export PATH=$PWD/bin:$PATH echo -n failed= >> $GITHUB_OUTPUT