-
Notifications
You must be signed in to change notification settings - Fork 21
139 lines (135 loc) · 5.11 KB
/
build.yml
File metadata and controls
139 lines (135 loc) · 5.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
name: Build And Test CWMS Data API
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
build:
strategy:
fail-fast: false
matrix:
jdk: [11]
# place holder for now and leaving commented but in place. General scheme target tests again the current release, the next release, the previous release, and latest development.
# at this time every possible instance of concern is on 25.07.01, once 26.02.17 is finalized it becomes release and 25.07.01 becomes previous.
# next-release will be comment out until such time as a RC gets made
schema:
- env: latest
image: "ghcr.io/hydrologicengineeringcenter/cwms-database/cwms/database-ready-ora-23.5:latest-dev"
- env: release
image: "ghcr.io/hydrologicengineeringcenter/cwms-database/cwms/database-ready-ora-23.5:25.07.01"
- env: next-release
image: "ghcr.io/hydrologicengineeringcenter/cwms-database/cwms/database-ready-ora-23.5:26.02.17-RC01"
# - env: previous
# image: "ghcr.io/hydrologicengineeringcenter/cwms-database/cwms/database-ready-ora-23.5:25.07.01"
name: build and test (jdk ${{matrix.jdk}}, schema ${{matrix.schema.env}})
runs-on: ubuntu-latest
outputs:
thewar: ${{steps.thebuild.outputs.WARFILE}}
steps:
- name: Clean up disk space, so we don't run out.
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- name: checkout code
uses: actions/checkout@v5.0.0
- name: setup java
uses: actions/setup-java@v5.2.0
with:
distribution: 'temurin'
java-version: ${{matrix.jdk}}
cache: 'gradle'
- name: build and test
id: thebuild
run: ./gradlew clean build --info --init-script init.gradle
- name: integration tests
run: ./gradlew integrationtest --info --init-script init.gradle -PCDA.oracle.database.image=${{matrix.schema.image}}
- name: Create matrix job badge
if: success() || failure() # always run even if the previous step fails
uses: ./.github/actions/badge
with:
label: 'Build'
status: ${{ job.status == 'success' && 'Pass' || 'Fail' }}
file: ${{ matrix.jdk }}/${{ matrix.schema.env }}.svg
run_id: ${{ github.run_id }}
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v5
# if: success() || failure() # always run even if the previous step fails
# with:
# annotate_only: true
# include_passed: true
# report_paths: '**/TEST-*.xml'
open-api-static-analysis:
name: OpenApi Static Analysis Tests
runs-on: ubuntu-latest
env:
OPEN_API_TEST: "true"
steps:
- name: checkout code
uses: actions/checkout@v5.0.0
- name: setup java
uses: actions/setup-java@v5.2.0
with:
distribution: 'temurin'
java-version: 11
cache: 'gradle'
- name: build and test
id: thebuild
run: ./gradlew clean :cwms-data-api:test --tests "cwms.cda.api.OpenApiDocTest" --info --init-script init.gradle
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always()
with:
annotate_only: true
include_passed: true
report_paths: '**/TEST-*.xml'
detailed_summary: true
build-docker-image:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v5.0.0
- name: Build docker image
run: docker build -t cda:build-latest .
build-schema-migration-image:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v5.0.0
# No uploads, we're just verifying that nothing broke the docker image.
- name: Build Migration image
uses: ./.github/actions/database-migration-image
with:
base-image: ghcr.io/hydrologicengineeringcenter/cwms-database/cwms/schema_installer
# TODO get current target image from build information
tag: latest-dev
badges:
needs: build
runs-on: ubuntu-latest
# we are reporing build state so always run, but only on builds on the main branch
if: always() && (github.ref_name == 'develop')
steps:
- name: Badge Branch
uses: actions/checkout@v5.0.0
with:
ref: badges
fetch-depth: 1
- name: Download badges
uses: actions/download-artifact@v4
with:
pattern: badges_${{ github.run_id }}_*
path: ./build # directory to download artifacts into
merge-multiple: true # downloaded artifacts will be in the same directory specified by path
- name: Apply Badge
run: |
find . -type f
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add build/**/*.svg
git status
git commit --allow-empty -m "Update Badge for build of ${{ github.sha }}"
git push origin badges -f