-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (133 loc) · 5.2 KB
/
github.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: ace-entities
on:
push:
branches:
- master
jobs:
# Build and test the applications with multiple Java versions
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [
'8.0.x',
'11.0.x',
'12.0.x',
'13.0.x',
'14.0.x',
'15.0.x',
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
architecture: x64
distribution: 'zulu'
cache: 'maven'
- name: Preliminary checks
run: |
./scripts/config.sh
- name: Package ACE entities
run: |
./scripts/build-ace-entities.sh --with-mysql
- name: Generate Jacoco Badge
if: ${{ matrix.java-version == '8.0.x' }}
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: coverage/target/site/jacoco-aggregate/jacoco.csv
- name: Log coverage percentage
if: ${{ matrix.java-version == '8.0.x' }}
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
- name: Move the badge to jacoco folder
if: ${{ matrix.java-version == '8.0.x' }}
run: |
mv .github/badges/*.svg coverage/target/site/jacoco-aggregate/
- name: Deploy Jacoco code coverage reports to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ matrix.java-version == '8.0.x' }}
with:
clean: true
folder: coverage/target/site/jacoco-aggregate
target-folder: reports
branch: gh-pages
# Build files necessary for building Docker Images (Dockerfiles and Contexts)
build-for-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 8.0.x
architecture: x64
distribution: 'zulu'
cache: 'maven'
- name: Prepare Dockerfiles and files for Contexts
run: |
./scripts/build-for-docker.sh
- name: Upload artifacts for Docker Image building
uses: actions/upload-artifact@v3
with:
name: files-for-docker
retention-days: 5
if-no-files-found: error
path: |
./docker-build/*
# Build multiarch Docker Images and push as GitHub Packages
docker-image-push:
if: ${{ github.repository == 'sifis-home/ace-entities' }}
needs: [build-and-test, build-for-docker]
runs-on: ubuntu-latest
steps:
- name: Download artifacts for Docker Image building
uses: actions/download-artifact@v3
with:
name: files-for-docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub container registry (ghcr.io)
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image (Authorization Server)
uses: docker/build-push-action@v4
with:
context: ace-entities/.
file: ace-entities/Dockerfile-AceAS
platforms: linux/amd64, linux/arm64, linux/arm
push: true
tags: ghcr.io/sifis-home/ace-authorization-server:latest
outputs: type=registry, annotation-index.org.opencontainers.image.description=ace-entities - ACE Authorization Server (includes revoked token notification and UCS). Configured with DHT logging enabled.
- name: Build and push image (Resource Server)
uses: docker/build-push-action@v4
with:
context: ace-entities/.
file: ace-entities/Dockerfile-AceRS
platforms: linux/amd64, linux/arm64, linux/arm
push: true
tags: ghcr.io/sifis-home/ace-resource-server:latest
outputs: type=registry, annotation-index.org.opencontainers.image.description=ace-entities - ACE Resource Server. Configured with CoAP Observe option enabled for the /trl endpoint.
- name: Build and push image (Client)
uses: docker/build-push-action@v4
with:
context: ace-entities/.
file: ace-entities/Dockerfile-AceClient
platforms: linux/amd64, linux/arm64, linux/arm
push: true
tags: ghcr.io/sifis-home/ace-client:latest
outputs: type=registry, annotation-index.org.opencontainers.image.description=ace-entities - ACE Client. Configured with CoAP Observe option enabled for the /trl endpoint.
- name: Build and push image (Client DHT)
uses: docker/build-push-action@v4
with:
context: ace-entities/.
file: ace-entities/Dockerfile-AceClientDht
platforms: linux/amd64, linux/arm64, linux/arm
push: true
tags: ghcr.io/sifis-home/ace-client-dht:latest
outputs: type=registry, annotation-index.org.opencontainers.image.description=ace-entities - ACE Client DHT. Configured with CoAP Observe option enabled for the /trl endpoint; configured with DHT connection enabled.