Bump next from 14.1.1 to 14.2.21 in /samples/nextjs-blog/app #125
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: Deploy Changed Samples | |
on: | |
pull_request: | |
paths: | |
- 'samples/**' | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
deploy_changed_samples: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: deploy_samples-group | |
environment: deploy-changed-samples | |
timeout-minutes: 90 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Identify changed samples | |
run: | | |
git fetch origin main | |
LAST_ANCESTOR=$(git merge-base HEAD origin/main) | |
git diff --name-only HEAD $LAST_ANCESTOR \ | |
| grep '^samples/' \ | |
| awk -F'/' '{print $1"/"$2}' \ | |
| 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 }} | |
TEST_AWS_SECRET_KEY: ${{ secrets.TEST_AWS_SECRET_KEY }} | |
TEST_BOARD_PASSWORD: ${{ secrets.TEST_BOARD_PASSWORD }} | |
TEST_DATABASE_HOST: ${{ secrets.TEST_DATABASE_HOST }} | |
TEST_DATABASE_NAME: ${{ secrets.TEST_DATABASE_NAME }} | |
TEST_DATABASE_PASSWORD: ${{ secrets.TEST_DATABASE_PASSWORD }} | |
TEST_DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }} | |
TEST_DATABASE_USERNAME: ${{ secrets.TEST_DATABASE_USERNAME }} | |
TEST_HASURA_GRAPHQL_ADMIN_SECRET: ${{ secrets.TEST_HASURA_GRAPHQL_ADMIN_SECRET }} | |
TEST_HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.TEST_HASURA_GRAPHQL_DATABASE_URL }} | |
TEST_HF_TOKEN: ${{ secrets.TEST_HF_TOKEN }} | |
TEST_MB_DB_DBNAME: ${{ secrets.TEST_MB_DB_DBNAME }} | |
TEST_MB_DB_HOST: ${{ secrets.TEST_MB_DB_HOST }} | |
TEST_MB_DB_PASS: ${{ secrets.TEST_MB_DB_PASS }} | |
TEST_MB_DB_PORT: ${{ secrets.TEST_MB_DB_PORT }} | |
TEST_MB_DB_USER: ${{ secrets.TEST_MB_DB_USER }} | |
TEST_MONGO_INITDB_ROOT_USERNAME: ${{ secrets.TEST_MONGO_INITDB_ROOT_USERNAME }} | |
TEST_MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.TEST_MONGO_INITDB_ROOT_PASSWORD }} | |
TEST_NC_DB: ${{ secrets.TEST_NC_DB }} | |
TEST_NC_S3_ENDPOINT: ${{ secrets.TEST_NC_S3_ENDPOINT }} | |
TEST_NC_S3_BUCKET_NAME: ${{ secrets.TEST_NC_S3_BUCKET_NAME }} | |
TEST_NC_S3_REGION: ${{ secrets.TEST_NC_S3_REGION }} | |
TEST_NC_S3_ACCESS_KEY: ${{ secrets.TEST_NC_S3_ACCESS_KEY }} | |
TEST_NC_S3_ACCESS_SECRET: ${{ secrets.TEST_NC_S3_ACCESS_SECRET }} | |
TEST_OPENAI_KEY: ${{ secrets.TEST_OPENAI_KEY }} | |
TEST_POSTGRES_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }} | |
TEST_QUEUE: ${{ secrets.TEST_QUEUE }} | |
TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }} | |
TEST_SECRET_KEY_BASE: ${{ secrets.TEST_SECRET_KEY_BASE }} | |
TEST_SESSION_SECRET: ${{ secrets.TEST_SESSION_SECRET }} | |
TEST_SLACK_CHANNEL_ID: ${{ secrets.TEST_SLACK_CHANNEL_ID }} | |
TEST_SLACK_TOKEN: ${{ secrets.TEST_SLACK_TOKEN }} | |
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: env.should_continue == 'true' && (success() || steps.run-tests.outcome == 'failure') # Always upload result unless cancelled | |
with: | |
name: program-output | |
path: output/** |