2020-12-27 14:15:41 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2021-01-15 19:34:04 +00:00
|
|
|
schedule:
|
|
|
|
# once per day
|
|
|
|
- cron: 0 0 * * *
|
2020-12-27 14:15:41 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- dev
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
|
2022-07-03 20:55:28 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-12-27 14:15:41 +00:00
|
|
|
jobs:
|
|
|
|
build-and-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-02 09:25:59 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-27 14:15:41 +00:00
|
|
|
|
2022-08-09 03:44:34 +00:00
|
|
|
- name: set up JDK 11
|
2022-04-11 09:16:36 +00:00
|
|
|
uses: actions/setup-java@v3
|
2020-12-27 14:15:41 +00:00
|
|
|
with:
|
2022-08-09 03:44:34 +00:00
|
|
|
java-version: '11'
|
2022-07-10 15:38:08 +00:00
|
|
|
distribution: 'temurin'
|
2020-12-27 14:15:41 +00:00
|
|
|
|
|
|
|
- name: Cache Gradle dependencies
|
2022-03-21 09:12:36 +00:00
|
|
|
uses: actions/cache@v3
|
2020-12-27 14:15:41 +00:00
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle
|
|
|
|
|
2021-01-15 19:34:04 +00:00
|
|
|
# See gradle file for difference between downloaders
|
2020-12-27 14:15:41 +00:00
|
|
|
- name: Build and run Tests
|
2021-01-15 19:34:04 +00:00
|
|
|
run: |
|
|
|
|
if [[ $GITHUB_EVENT_NAME == 'schedule' ]]; then
|
2021-01-17 18:52:28 +00:00
|
|
|
echo running with real downloader
|
2021-01-15 19:34:04 +00:00
|
|
|
./gradlew check --stacktrace -Ddownloader=REAL
|
|
|
|
else
|
2021-01-17 18:52:28 +00:00
|
|
|
echo running with mock downloader
|
2021-01-15 19:34:04 +00:00
|
|
|
./gradlew check --stacktrace -Ddownloader=MOCK
|
|
|
|
fi
|
2022-03-26 18:57:17 +00:00
|
|
|
|
|
|
|
- name: Upload test reports when failure occurs
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: NewPipeExtractor-test-reports
|
|
|
|
path: extractor/build/reports/tests/test/**
|