forked from Tobeto-dotNet2A-Pair2/LibraryManagementSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (39 loc) · 1.97 KB
/
postman.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Automated API tests using Postman CLI
on: push
jobs:
automated-api-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.205'
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20.11.1'
- name: Install Node.js dependencies
run: npm install
working-directory: https://github.com/Test-3A-Pair-6/LibraryManagementSystem/tree/main/librarymanagementsystem-frontend
- name: Build Angular project
run: npm run build
working-directory: https://github.com/Test-3A-Pair-6/LibraryManagementSystem/tree/main/librarymanagementsystem-frontend
- name: Install .NET dependencies
run: dotnet restore
working-directory: https://github.com/Test-3A-Pair-6/LibraryManagementSystem/tree/main/librarymanagementsystem-backend
- name: Build .NET project
run: dotnet build --configuration Release
working-directory: https://github.com/Test-3A-Pair-6/LibraryManagementSystem/tree/main/librarymanagementsystem-backend
- name: Start .NET API server
run: |
dotnet run --no-build --project https://github.com/Test-3A-Pair-6/LibraryManagementSystem/tree/main/librarymanagementsystem-backend
Start-Sleep -s 10 # Wait for the server to start
- name: Install Postman CLI
run: |
powershell.exe -NoProfile -InputFormat None -ExecutionPolicy AllSigned -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://dl-cli.pstmn.io/install/win64.ps1'))"
- name: Login to Postman CLI
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Run API tests
run: |
postman collection run "24412719-c07f3885-9a3d-4d2e-98b9-82c42e0a57fa" -e "24412719-04416698-a03d-471a-834a-38bf4922a759"