Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add smoke test for the pull request BM-1012 BM-1010 #3234

Merged
merged 7 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: smoke

on:
pull_request:
push:
branches:
- master

jobs:
smoke:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: linz/action-typescript@v3

# Package all the files
- name: Bundle & Package all files
run: |
npx lerna run bundle --stream
npm pack --workspaces
env:
NODE_ENV: 'production'

- name: (NonProd) Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-region: ap-southeast-2
mask-aws-account-id: true
role-to-assume: ${{ secrets.AWS_ROLE_SCREENSHOT }}

- name: (Smoke) Run Smoke Tests
run: |
# Copy the static files for v1/health check
cp -r packages/lambda-tiler/static/ .
./packages/cli/bin/bmc.js serve --config s3://linz-basemaps/config/config-latest.json.gz &

# Wait for the server to start
timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:5000/v1/version)" != "200" ]]; do sleep 0.5; done' || false

BASEMAPS_HOST=http://localhost:5000 node --test packages/smoke/build/*.test.js
env:
GIT_VERSION: $(git describe --tags --always --match 'v*')
GIT_HASH: $(git rev-parse HEAD)
Loading