Skip to content

Commit

Permalink
abort workflow if no changes found
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanstephens committed Nov 22, 2024
1 parent 6b7555c commit dc5376b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/deploy-changed-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,37 @@ jobs:
| sort \
| uniq > changed_samples.txt
if [ -s changed_samples.txt ]; then
echo "should_continue=true" >> $GITHUB_ENV
echo "The following samples have changed:"
cat changed_samples.txt
else
echo "should_continue=false" >> $GITHUB_ENV
echo "No samples have changed. Exiting..."
fi
- name: Install Golang
uses: actions/setup-go@v5
with:
go-version-file: tools/testing/go.mod
cache-dependency-path: |
tools/testing/go.sum
if: env.should_continue == 'true'

- name: Build the test tool using Go
run: |
go mod tidy
go build ./cmd/loadtest
working-directory: tools/testing/
if: env.should_continue == 'true'

- name: Install Defang
run: |
eval "$(curl -fsSL s.defang.io/install)"
if: env.should_continue == 'true'

- name: Run tests
id: run-tests
shell: bash # implies set -o pipefail, so pipe below will keep the exit code from loadtest
if: env.should_continue == 'true'
env:
FIXED_VERIFIER_PK: ${{ secrets.FIXED_VERIFIER_PK }}
TEST_AWS_ACCESS_KEY: ${{ secrets.TEST_AWS_ACCESS_KEY }}
Expand Down Expand Up @@ -92,16 +97,14 @@ jobs:
run: |
SAMPLES=$(sed 's|^samples/||' changed_samples.txt | paste -s -d ',' -)
echo "Running tests for samples: $SAMPLES"
mkdir output
# concurrency is set to 10 to avoid exhausting our fargate vCPU limits when running
# kaniko builds, which consume 4 vCPUs each. the limit is currently set to 60--6.5 of
# which are used to run the staging stack. So floor((60-6.5)/4) = 13 is our upper limit
./tools/testing/loadtest -c fabric-staging.defang.dev:443 --timeout=15m --concurrency=10 -s $SAMPLES -o output --markdown=true | tee output/summary.log | grep -v '^\s*[-*]' # removes load sample log lines
- name: Upload Output as Artifact
uses: actions/upload-artifact@v4
if: success() || steps.run-tests.outcome == 'failure' # Always upload result unless cancelled
if: env.should_continue == 'true' && (success() || steps.run-tests.outcome == 'failure') # Always upload result unless cancelled
with:
name: program-output
path: output/**

0 comments on commit dc5376b

Please sign in to comment.