forked from aehrc/pathling
-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (117 loc) · 4.35 KB
/
test.yml
File metadata and controls
135 lines (117 loc) · 4.35 KB
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
# This workflow will build the software to ensure there are no errors, and also execute the tests.
name: Test
# This workflow runs on all pull requests except those from release branches.
on:
pull_request_target:
env:
# The add-exports and add-opens flags are required for Java 17
MAVEN_OPTS: --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest
# Skip pull requests from release branches (handled by pre-release workflow).
if: "!startsWith(github.head_ref, 'release/')"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "zulu"
- name: Set up Python 3.8
uses: actions/setup-python@v4
id: python-install
with:
python-version: 3.8
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: "4.1.3"
use-public-rspm: true
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |-
${{ runner.os }}-maven-
- name: Cache Python packages
uses: actions/cache@v4
with:
path: /home/runner/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('lib/python/requirements/dev.txt', 'lib/python/requirements/package.txt') }}
- name: Cache R packages
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/Library
key: r-packages-${{ runner.os }}-${{ hashFiles('lib/R/DESCRIPTION.src') }}
restore-keys: r-packages-${{ runner.os }}-
- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Install TinyTeX and libcurl
# These are required for building the R package documentation.
run: |
wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh
echo "$HOME/bin" >> $GITHUB_PATH
sudo apt-get install -y libcurl4-openssl-dev
- name: Run install goal
if: (!(startsWith(steps.extract-info.outputs.branch_name , 'release/') && endsWith(steps.extract-info.outputs.maven_version, '-SNAPSHOT')))
env:
PYSPARK_PYTHON: ${{ steps.python-install.outputs.python-path }}
PYSPARK_DRIVER_PYTHON: ${{ steps.python-install.outputs.python-path }}
R_KEEP_PKG_SOURCE: yes
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn --batch-mode install \
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-Dsonar.projectKey=aehrc_pathling -Dsonar.organization=aehrc \
-Dsonar.host.url=https://sonarcloud.io \
-pl '!site,!benchmark'
timeout-minutes: 60
- name: Save test reports
uses: actions/upload-artifact@v4
with:
name: surefire-reports
path: "**/surefire-reports/"
- name: Save coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
**/jacoco.xml
**/target/site/jacoco
**/target/site/jacoco-aggregate
lib/python/**/coverage.xml
- name: Save built JARs
uses: actions/upload-artifact@v4
with:
name: jars
path: |
utilities/target/utilities-*.jar
encoders/target/encoders-*.jar
terminology/target/terminology-*.jar
fhirpath/target/fhirpath-*.jar
library-api/target/library-api-*.jar
library-runtime/target/library-runtime-*.jar
lib/python/target/python-*.jar
lib/R/target/r-*.jar
if-no-files-found: "error"
- name: Save Python wheel
uses: actions/upload-artifact@v4
with:
name: python-wheel
path: lib/python/target/py-dist/pathling-*.whl
- name: Save R package
uses: actions/upload-artifact@v4
with:
name: r-package
path: lib/R/target/pathling_*.tar.gz