Skip to content

Commit

Permalink
build: Add smoke test for the pull request BM-1012 BM-1010 (#3234)
Browse files Browse the repository at this point in the history
#### Motivation

Add a new workflow that runs smoke tests for the pull requests.

#### Modification

A new workflow called `smoke` which run a local server and run the smoke
tests on the server.

#### Checklist

- [ ] Tests updated
- [ ] Docs updated
- [ ] Issue linked in Title

---------

Co-authored-by: Blayne Chard <[email protected]>
  • Loading branch information
Wentao-Kuang and blacha authored Apr 18, 2024
1 parent 95addbb commit c5340d0
Showing 1 changed file with 45 additions and 0 deletions.
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/[email protected]
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)

0 comments on commit c5340d0

Please sign in to comment.