forked from carbynestack/cli-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (95 loc) · 3.15 KB
/
build-and-test.yaml
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
#
# Copyright (c) 2021 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/cli-ng.
#
# SPDX-License-Identifier: Apache-2.0
#
name: Artifacts
on:
workflow_dispatch:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
env:
SHELL: /bin/bash
jobs:
verification:
runs-on: ubuntu-20.04
permissions:
contents: read
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Verify changed files
uses: pre-commit/[email protected]
test:
runs-on: ubuntu-20.04
needs: verification
strategy:
fail-fast: false
matrix:
jdk: [ 17 ]
distribution: [ temurin,graalvm ]
compilation: [ jit,aot ]
exclude:
- distribution: temurin
compilation: aot
env:
JDK: ${{ matrix.jdk }}
DISTRIBUTION: ${{ matrix.distribution }}
COMPILATION: ${{ matrix.compilation }}
steps:
- uses: actions/checkout@v2
- name: Set up GraalVM JDK ${{ matrix.jdk }}
if: contains(matrix.distribution, 'graal')
uses: graalvm/setup-graalvm@v1
with:
version: '21.3.0'
java-version: ${{ matrix.jdk }}
components: 'native-image'
cache: 'maven'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Temurin JDK ${{ matrix.jdk }}
if: contains(matrix.distribution, 'temurin')
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Setting up Github Package Repository as Maven Repository
uses: s4u/maven-settings-action@v2
with:
githubServer: false
servers: |
[{
"id": "github",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"
}]
- name: Build with Maven
if: (!contains(matrix.compilation, 'aot'))
run: mvn install -Dskip.tests --batch-mode --update-snapshots --no-transfer-progress
- name: Native build with Maven
if: contains(matrix.compilation, 'aot')
run: mvn clean -Pnative -DskipTests -Dskip.tests package --batch-mode --update-snapshots --no-transfer-progress
- name: Run tests
if: (!contains(matrix.compilation, 'aot'))
run: mvn verify --activate-profiles coverage --batch-mode --no-transfer-progress
- name: Native tests run
if: contains(matrix.compilation, 'aot')
run: mvn clean -Pnative -Dagent=true test --batch-mode --no-transfer-progress
- name: Collect Jacoco reports
run: echo ::set-output name=reports::$(find . -regex '.*/target/site/jacoco/jacoco.xml' | tr '\n' ',' | sed 's/.$//')
id: jacoco
- uses: codecov/codecov-action@v2
if: (!contains(matrix.compilation, 'aot'))
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.jacoco.outputs.reports }}
env_vars: JDK,DISTRIBUTION,COMPILATION
fail_ci_if_error: true
name: codecov