-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (86 loc) · 2.64 KB
/
lib-build.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: build
on:
workflow_call:
inputs:
environment:
required: true
type: string
module:
required: true
type: string
workflow_dispatch:
inputs:
environment:
required: true
type: choice
options:
- dev
- test
module:
required: true
type: choice
options:
- api
- worker
jobs:
build:
runs-on: self-hosted
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
AWS_REGION: ${{ vars.AWS_REGION }}
DEPLOYMENT_ENV: ${{ vars[format('{0}_DEPLOYMENT_ENV', inputs.environment)] }}
steps:
- name: Checkout AB2D-Libs Repository
uses: actions/checkout@v4
with:
repository: 'cmsgov/AB2D-Libs'
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: '8.10'
- name: Set env vars from AWS params in BCDA management account
uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main
with:
params: |
ARTIFACTORY_URL=/artifactory/url
ARTIFACTORY_USER=/artifactory/user
ARTIFACTORY_PASSWORD=/artifactory/password
- name: Build Libraries
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
gradle -b build.gradle
- name: Test Libraries
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
gradle clean test --info -b build.gradle
- name: Build Jars
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
gradle jar --info -b build.gradle
- name: SonarQube Analysis
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
gradle sonarqube \
-Dsonar.projectKey=ab2d-lib-project \
-Dsonar.host.url=https://sonarqube.cloud.cms.gov \
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
- name: Quality Gate
id: quality-gate
uses: sonarsource/sonarcloud-github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 10