forked from archiver-appliance/epicsarchiverap
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (118 loc) · 3.78 KB
/
test-and-build.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
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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Test and Build Test Versions
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "*" ]
permissions:
contents: read
checks: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
unittests:
name: Build and run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: unitests-build-reports
path: build/reports/
- name: Upload package
if: always()
uses: actions/upload-artifact@v4
with:
name: test-package
path: build/distributions/*.tar.gz
epicstests:
name: Run all unit tests reliant on EPICS install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create Build Reports Folder
run: mkdir -p build/reports/tests
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run tests with docker compose
run: docker compose -f docker/docker-compose.epicsTests.yml run epicsarchiver-test
env:
DOCKER_DEFAULT_PLATFORM: linux/amd64
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/epicsTests/TEST-*.xml'
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: epicstests-build-reports
path: build/reports/
build-custom-version:
needs: [unittests, epicstests]
name: Build Slacdev and Default site version
runs-on: ubuntu-latest
strategy:
matrix:
siteid: ["slacdev", "default", "tests"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew assemble
env:
ARCHAPPL_SITEID: ${{ matrix.siteid }}
- name: Upload package
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.siteid }}-package
path: build/distributions/*.tar.gz