-
Notifications
You must be signed in to change notification settings - Fork 105
78 lines (77 loc) · 2.92 KB
/
ci.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
name: CI
'on':
push:
branches:
- master
pull_request:
branches:
- master
jobs:
# FIXME: hadolint won't work since the docker file has not been updated.
# lint-dockerfile:
# name: Lint Dockerfile
# runs-on: ubuntu-latest
# steps:
# - name: Git checkout
# uses: actions/checkout@v2
# - name: Run Hadolint Dockerfile Linter (Common)
# uses: burdzwastaken/hadolint-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# HADOLINT_ACTION_DOCKERFILE_FOLDER: docker/cygnus-common
# - name: Run Hadolint Dockerfile Linter (NGSI)
# uses: burdzwastaken/hadolint-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# HADOLINT_ACTION_DOCKERFILE_FOLDER: docker/cygnus-ngsi
# - name: Run Hadolint Dockerfile Linter (NGSI-LD)
# uses: burdzwastaken/hadolint-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# HADOLINT_ACTION_DOCKERFILE_FOLDER: docker/cygnus-ngsi-ld
# - name: Run Hadolint Dockerfile Linter (Twitter)
# uses: burdzwastaken/hadolint-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# HADOLINT_ACTION_DOCKERFILE_FOLDER: docker/cygnus-twitter
unit-test:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
java-version:
- 11
- 12
- 13
- 14
- 15
- 16
- 17
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: 'Use Java ${{ matrix.java-version }}'
uses: actions/setup-java@v1
with:
java-version: '${{ matrix.java-version }}'
- name: 'cygnus-common Unit Tests (Java ${{ matrix.java-version }})'
run: |
cd "${GITHUB_WORKSPACE}"/cygnus-common
mvn -q test
# Build and install cygnus-common, this is necessary because it is a dependency for cygnus-ngsi and others
mvn -q clean compile exec:exec assembly:single
VERSION=$(cat pom.xml | grep version | sed -n '1p' | sed -ne '/<version>/s#\s*<[^>]*>\s*##gp' | sed 's/ //g')
mvn -q install:install-file -Dfile=target/cygnus-common-$VERSION-jar-with-dependencies.jar -DgroupId=com.telefonica.iot -DartifactId=cygnus-common -Dversion=$VERSION -Dpackaging=jar -DgeneratePom=true
- name: 'cygnus-ngsi Unit Tests (Java ${{ matrix.java-version }})'
run: |
cd "${GITHUB_WORKSPACE}"/cygnus-ngsi
mvn -q test
- name: 'cygnus-ngsi-ld Unit Tests (Java ${{ matrix.java-version }})'
run: |
cd "${GITHUB_WORKSPACE}"/cygnus-ngsi-ld
mvn -q test
# FIXME: placeholder for future cygnus-twitter tests
#- name: 'cygnus-twitter Unit Tests (Java ${{ matrix.java-version }})'
# run: |
# cd "${GITHUB_WORKSPACE}"/cygnus-twitter
# mvn -q test