-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (68 loc) · 2.15 KB
/
default.yml
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
name: CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
build:
name: Build, Test, and Analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v4.6.0
with:
java-version: 17
distribution: 'temurin'
- name: Cache SonarCloud packages
uses: actions/cache@v4.2.0
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Setup Gradle
uses: gradle/gradle-build-action@v3.5.0
with:
dependency-graph: generate-and-submit
- name: Build
run: ./gradlew build
#Disabling integration tests for now. Should work more reliably
#after getting testcontainer support going with the opendcs test fixtures
# - name: Install Docker Compose
# run: |
# sudo apt-get update
# sudo apt-get install -y docker-compose
# - name: Verify Docker Compose installation
# run: docker-compose --version
# - name: Validate docker-compose.yaml
# run: docker-compose -f opendcs-rest-api-jetty/docker-compose.yml config
# - name: Integration Tests
# run: ./gradlew integrationTest --stacktrace --info
- name: Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar
- name: Bundle tarballs
run: ./gradlew bundle
- name: Upload WAR files
uses: actions/upload-artifact@v4.6.0
with:
name: warfile
path: ./**/build/libs/*.war
retention-days: 1
if-no-files-found: error
- name: Upload Tarballs
uses: actions/upload-artifact@v4.6.0
with:
name: opendcs-rest-api-artifacts
path: ./**/build/distributions/*.tar.gz
retention-days: 1
if-no-files-found: error