forked from Unidata/netcdf-java
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (104 loc) · 4.83 KB
/
tds-check.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
on:
pull_request:
paths:
- '**.temporarily-disable'
jobs:
tests-adpotopenjdk-hs-8:
name: TDS Tests using netCDF-Java from PR (AdoptOpenJDK-HS 8)
runs-on: ubuntu-latest
steps:
- name: Checkout netCDF-Java PR
uses: actions/checkout@v4
- name: Fetch latest AdoptOpenJDK 8 (hotspot) built for linux"
run: curl -L "https://api.adoptopenjdk.net/v2/binary/releases/openjdk8?openjdk_impl=hotspot&arch=x64&release=latest&type=jdk&os=linux" -o aojdk8-hs.tar.gz
- name: Setup Latest AdoptOpenJDK (hotspot) 8
uses: actions/setup-java@master
with:
java-version: 8
architecture: x64
jdkFile: ./aojdk8-hs.tar.gz
- name: Print java version
run: java -version
- name: Install netCDF-C and sed
run: sudo apt update && sudo apt-get install libnetcdf-dev sed
- name: Build netCDF-java and publish to local maven repository
run: ./gradlew assemble publishToMavenLocal
- name: Checkout TDS Master
uses: actions/checkout@v4
with:
repository: Unidata/tds
path: tds_build_dir
- name: Modify, build, and test the TDS
shell: bash
run: |
echo "Find netcdf-java version as specified in the PR"
NCJ_VERSION=$(./gradlew properties -q | grep "^version:" | awk '{print $2}')
echo "Change directory to local TDS repository"
cd tds_build_dir
TDS_BUILD_DIR=`pwd`
# tell tds build to use snapshots from the local maven repo
echo "Tell the TDS build to look in the local maven repository for artifacts first..."
sed -i 's/\/\/mavenLocal()/mavenLocal()/g' ./gradle/any/dependencies.gradle
# make sure we are using the version of netCDF-Java specified in the PR to build the TDS
sed -i 's/versions\["ncj"\] =.*$/versions["ncj"] ="'${NCJ_VERSION}'"/g' ./gradle/any/dependencies.gradle
# setup env vars for tds buildTestDSR
CONTENT_ROOT="-Dtds.content.root.path=${TDS_BUILD_DIR}/tds/src/test/content"
SYSTEM_PROPS="$CONTENT_ROOT"
# run tds tests
echo "Run the TDS tests"
./gradlew $SYSTEM_PROPS --info --stacktrace testAll
- uses: actions/upload-artifact@v1
if: failure()
with:
name: TDS_JUnit_Results_${{ github.sha }}
path: tds_build_dir/build/reports/allTests
tests-with-builders-adpotopenjdk-hs-8:
name: TDS Tests (with builders) using netCDF-Java from PR (AdoptOpenJDK-HS 8)
runs-on: ubuntu-latest
steps:
- name: Checkout netCDF-Java PR
uses: actions/checkout@v4
- name: Fetch latest AdoptOpenJDK 8 (hotspot) built for linux"
run: curl -L "https://api.adoptopenjdk.net/v2/binary/releases/openjdk8?openjdk_impl=hotspot&arch=x64&release=latest&type=jdk&os=linux" -o aojdk8-hs.tar.gz
- name: Setup Latest AdoptOpenJDK (hotspot) 8
uses: actions/setup-java@master
with:
java-version: 8
architecture: x64
jdkFile: ./aojdk8-hs.tar.gz
- name: Print java version
run: java -version
- name: Install netCDF-C and sed
run: sudo apt update && sudo apt-get install libnetcdf-dev sed
- name: Build netCDF-java and publish to local maven repository
run: ./gradlew assemble publishToMavenLocal
- name: Checkout TDS Master
uses: actions/checkout@v4
with:
repository: Unidata/tds
path: tds_build_dir
- name: Modify, build, and test the TDS
shell: bash
run: |
echo "Find netcdf-java version as specified in the PR"
NCJ_VERSION=$(./gradlew properties -q | grep "^version:" | awk '{print $2}')
echo "Change directory to local TDS repository"
cd tds_build_dir
TDS_BUILD_DIR=`pwd`
# tell tds build to use snapshots from the local maven repo
echo "Tell the TDS build to look in the local maven repository for artifacts first..."
sed -i 's/\/\/mavenLocal()/mavenLocal()/g' ./gradle/any/dependencies.gradle
# make sure we are using the version of netCDF-Java specified in the PR to build the TDS
sed -i 's/versions\["ncj"\] =.*$/versions["ncj"] ="'${NCJ_VERSION}'"/g' ./gradle/any/dependencies.gradle
# setup env vars for tds buildTestDSR
CONTENT_ROOT="-Dtds.content.root.path=${TDS_BUILD_DIR}/tds/src/test/content"
BUILDERS="-Dthredds.test.experimental.useNetcdfJavaBuilders=true"
SYSTEM_PROPS="$CONTENT_ROOT $BUILDERS"
# run tds tests
echo "Run the TDS tests"
./gradlew $SYSTEM_PROPS --info --stacktrace testAll --refresh-dependencies
- uses: actions/upload-artifact@v1
if: failure()
with:
name: TDS_JUnit_Results_${{ github.sha }}
path: tds_build_dir/build/reports/allTests