This repository was archived by the owner on Mar 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (49 loc) · 1.92 KB
/
Copy pathmain.yml
File metadata and controls
49 lines (49 loc) · 1.92 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
name: CI
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Set up java environment
uses: actions/setup-java@v1
with:
java-version: '1.8.0'
- name: Build source code
run: ./mvnw clean compile
- name: Run Unit Tests
run: ./mvnw test
- name: Download Codacy binary
run: curl -Ls -o codacy-coverage-reporter "$(curl -Ls https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r '.assets | map({name, browser_download_url} | select(.name | contains("codacy-coverage-reporter-linux"))) | .[0].browser_download_url')"
- name: Configure Codacy Binary
run: chmod +x codacy-coverage-reporter
- name: Check Commit SHA
run: echo $GITHUB_SHA
- name: Push unit test results to Codacy
run: CODACY_PROJECT_TOKEN=${{ secrets.CODACY_TOKEN }} ./codacy-coverage-reporter report -l Java --commit-uuid "$GITHUB_SHA" -r target/site/jacoco/jacoco.xml
integration-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Setup Java Environment
uses: actions/setup-java@v1
with:
java-version: '1.8.0'
- name: Build Code (Development)
run: ./mvnw clean package -P it -Dmaven.test.skip=true
- name: Start Application
run: java -jar -Dmax.image.size=1000 target/api-service-0.0.1-SNAPSHOT.jar &
- name: Wait Service to Start
uses: nev7n/wait_for_response@v1
with:
url: 'http://localhost:8082/actuator/health'
responseCode: 200
timeout: 120000
interval: 500
- name: Run Integration Tests
uses: matt-ball/newman-action@master
with:
collection: postman/CodesupportApi.postman_collection.json
environment: postman/Local.postman_environment.json