Skip to content

Commit a1dbe35

Browse files
committed
Refactor the CI workflow
Refactor the CI pipeline so it runs on any push to the repo and only runs a compile and test. This will means the build runs quicker and it saves us time on Github. A separate workflow will be defined to do the security scanning (if it is necessary)
1 parent de28543 commit a1dbe35

File tree

2 files changed

+47
-131
lines changed

2 files changed

+47
-131
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 131 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Continuous Integration Pipeline
2+
3+
on:
4+
push:
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
env:
11+
JAVA_VERSION: '17'
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up JDK
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: ${{ env.JAVA_VERSION }}
23+
distribution: 'temurin'
24+
cache: maven
25+
26+
- name: Run Tests
27+
run: mvn test
28+
29+
- name: Upload JaCoCo reports
30+
if: always()
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: jacoco-reports
34+
path: target/site/jacoco/
35+
36+
- name: Setup Code Climate
37+
run: |
38+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
39+
chmod +x ./cc-test-reporter
40+
./cc-test-reporter before-build
41+
42+
- name: Run Code Climate Analysis
43+
env:
44+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
45+
run: |
46+
JACOCO_SOURCE_PATH=src/main/java ./cc-test-reporter format-coverage target/site/jacoco/jacoco.xml --input-type jacoco
47+
./cc-test-reporter upload-coverage

0 commit comments

Comments
 (0)