-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 2.11 KB
/
Copy pathapi-tests.yml
File metadata and controls
63 lines (55 loc) · 2.11 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
name: Rest Assured API Tests
# Module 19 adds the first executable CI workflow. The workflow intentionally
# runs the full TestNG suite, while the smaller parallel suite remains a local
# smoke option that teaches controlled parallelization.
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
test:
name: Maven TestNG Suite
runs-on: ubuntu-latest
steps:
# GitHub-hosted runners start with an empty workspace. Checkout is the
# step that downloads this repository so Maven can see pom.xml, src/,
# testng.xml, and the framework resources.
- name: Checkout
uses: actions/checkout@v4
# The local learning framework is built on Java 21. CI must use the same
# major Java version so language features, compiler behavior, and Maven
# dependency resolution match the learner's machine.
- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven
# suiteXmlFile is read by the Maven Surefire configuration in pom.xml.
# Passing testng.xml makes CI execute the same curated suite learners run
# locally instead of relying on accidental classpath discovery.
- name: Run full TestNG suite
run: mvn test -DsuiteXmlFile=testng.xml
# Reports are uploaded even when tests fail. That is essential in API
# automation because failed CI jobs need request/response evidence,
# assertion output, and framework diagnostics after the runner shuts down.
- name: Upload Surefire reports
if: always()
uses: actions/upload-artifact@v4
with:
name: surefire-reports
path: target/surefire-reports/
- name: Upload Allure results
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results
path: target/allure-results/
- name: Upload Extent report
if: always()
uses: actions/upload-artifact@v4
with:
name: extent-report
path: target/extent-report/