-
Notifications
You must be signed in to change notification settings - Fork 25
35 lines (31 loc) · 1.77 KB
/
api-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: MPS API Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- run: docker build -f Dockerfile -t mps:${GITHUB_SHA} .
- run: docker-compose up -d
- run: sleep 30
- run: docker run --network=host -v /home/runner/work/mps/mps/src/test/collections/:/collections -v /home/runner/work/mps/mps/src/test/results/:/results postman/newman run /collections/MPS.postman_collection.json -e /collections/MPS.postman_environment.json --insecure --reporters cli,json,junit --reporter-json-export /results/mps_api_results.json --reporter-junit-export /results/mps_api_results_junit.xml
- run: docker run --network=host -v /home/runner/work/mps/mps/src/test/collections/:/collections -v /home/runner/work/mps/mps/src/test/results/:/results postman/newman run /collections/mps_security_api_test_postman_collection.json -e /collections/MPS.postman_environment.json -d /collections/data/mps_security_api_test_data.json --insecure --reporters cli,json,junit --reporter-json-export /results/mps_api_security_results.json --reporter-junit-export /results/mps_api_security_results_junit.xml
- name: Dump docker logs on
if: failure()
uses: jwalton/gh-docker-logs@59c9656cd3cb7542525f3dce7ae2f44c0ff85d66 # v2.2.1
- name: Upload Postman Results
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: mps-api
path: /home/runner/work/mps/mps/src/test/results