Skip to content

feat: add getting started for SQS triggers #9

feat: add getting started for SQS triggers

feat: add getting started for SQS triggers #9

---
name: trigger-functions-offline-testing
# The tests themselves are written with osht, a bash testing framework.
# See: https://github.com/coryb/osht
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
TRIGGERS_GETTING_STARTED_FOLDER: functions/triggers-getting-started
OFFLINE_SERVER_URL: http://localhost:8080
jobs:
triggers-node:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install node dev requirements
run: |
cd ${{ env.TRIGGERS_GETTING_STARTED_FOLDER }}/node
npm install
- name: Install osht
run: curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh > osht.sh
- name: Run node offline testing
uses: BerniWittmann/background-server-action@v1
with:
command: |
source osht.sh && \
IS $(curl -q ${{ env.OFFLINE_SERVER_URL }}) == "Method not allowed" && \
IS $(curl -q -d 5 ${{ env.OFFLINE_SERVER_URL }}) == 120
start: npm start --prefix ${{ env.TRIGGERS_GETTING_STARTED_FOLDER }}/node
wait-on: ${{ env.OFFLINE_SERVER_URL }}
wait-on-timeout: 60