Skip to content

style: turn of ts comment lint errors #129

style: turn of ts comment lint errors

style: turn of ts comment lint errors #129

Workflow file for this run

name: Test - Pull Requests
on:
push
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Enable Corepack before setting up Node
run: corepack enable
- name: Install dependencies
uses: actions/setup-node@v4
with:
node-version: 22.3.0
- run: yarn install --immutable
- name: Run lint and test
uses: actions/setup-node@v4
with:
node-version: 22.3.0
- run: yarn run build
- run: yarn run lint
- run: yarn run test:unit
- run: yarn run test:e2e
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
target: tonomy_communication_base
push: false
tags: tonomy/communication:development
- name: "Run docker container to check it can run"
run: |
docker run \
--add-host host.docker.internal:host-gateway \
-p 5000:5000 \
tonomy/communication:development \
yarn run start:prod &
sleep 5
curl http://localhost:5000
zap_scan:
runs-on: ubuntu-latest
name: OWASP ZAP API Scan
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack before setting up Node
run: corepack enable
- name: Build and run server
uses: actions/setup-node@v4
with:
node-version: 22.3.0
- run: yarn install --immutable
- run: yarn run build
- run: yarn run start:prod &
- run: sleep 3
- name: Run ZAP API Scan
id: zap_scan
# https://www.zaproxy.org/docs/docker/api-scan/
run: |
set +e
docker run \
--add-host host.docker.internal:host-gateway \
-v $(pwd):/zap/wrk/:rw \
-u root \
-t \
ghcr.io/zaproxy/zaproxy:stable \
zap-api-scan.py \
-t http://host.docker.internal:5000/openapi.json \
-f openapi \
-g gen.conf \
-r zap-api-scan-report.html \
-a
EXIT_CODE="$?"
echo "EXIT_CODE=$EXIT_CODE" >> $GITHUB_OUTPUT
# https://github.com/orgs/community/discussions/46992#discussioncomment-4961541
- name: Upload ZAP Scan Output
uses: actions/upload-artifact@v3
with:
name: zap-scan-output
path: "zap-api-scan-report.html"
# Exit with the exit code of the ZAP scan
- run: exit "${{ steps.zap_scan.outputs.EXIT_CODE }}"