forked from trinodb/trino
-
Notifications
You must be signed in to change notification settings - Fork 7
131 lines (124 loc) · 4.94 KB
/
docs.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
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
name: docs
on:
pull_request:
paths:
- 'docs/**'
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
env:
# An envar that signals to tests we are executing in the CI environment
CONTINUOUS_INTEGRATION: true
# allow overriding Maven command
MAVEN: ./mvnw
# maven.wagon.rto is in millis, defaults to 30m
MAVEN_OPTS: "-Xmx512M -XX:+ExitOnOutOfMemoryError -Dmaven.wagon.rto=60000"
MAVEN_INSTALL_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError -Dmaven.wagon.rto=60000"
MAVEN_FAST_INSTALL: "-B --strict-checksums -V --quiet -T 1C -DskipTests -Dair.check.skip-all"
MAVEN_TEST: "-B --strict-checksums -Dair.check.skip-all --fail-at-end"
RETRY: .github/bin/retry
# Cancel previous PR builds.
concurrency:
# Cancel all workflow runs except latest within a concurrency group. This is achieved by defining a concurrency group for the PR.
# Non-PR builds have singleton concurrency groups.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
cancel-in-progress: true
jobs:
path-filters:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
other: ${{ steps.filter.outputs.other }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docs: 'docs/**'
other: '!docs/**'
docs-checks:
needs: path-filters
if: ${{ needs.path-filters.outputs.docs == 'true' && needs.path-filters.outputs.other == 'false' }}
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin' # use same JDK distro as in Trino docker images
java-version: 17
cache: 'maven'
- name: Configure Problem Matchers
run: |
echo "::add-matcher::.github/problem-matcher.json"
- name: Maven Checks
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY $MAVEN install -B --strict-checksums -V -T 1C -DskipTests -P ci -am -pl ':trino-docs'
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository
test-docs:
needs: path-filters
if: ${{ needs.path-filters.outputs.docs == 'true' && needs.path-filters.outputs.other == 'false' && !contains(github.event.pull_request.labels.*.name, 'release-notes') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
modules:
- ":trino-main"
- ":trino-plugin-toolkit"
- ":trino-resource-group-managers"
- ":trino-tests"
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # checkout all commits, as the build result depends on `git describe` equivalent
- uses: actions/setup-java@v3
with:
distribution: 'temurin' # use same JDK distro as in Trino docker images
java-version: 17
cache: 'maven'
- name: Configure Problem Matchers
run: |
echo "::add-matcher::.github/problem-matcher.json"
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY $MAVEN install ${MAVEN_FAST_INSTALL} -am -pl $(echo '${{ matrix.modules }}' | cut -d' ' -f1)
- name: Maven Tests
run: $MAVEN test ${MAVEN_TEST} -pl ${{ matrix.modules }}
- name: Sanitize artifact name
if: always()
run: |
# Generate a valid artifact name and make it available to next steps as
# an environment variable ARTIFACT_NAME
# ", :, <, >, |, *, ?, \, / are not allowed in artifact names but we only use : so we remove it
name=$(echo -n "${{ matrix.modules }}" | sed -e 's/[:]//g')
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV
- name: Upload test results
uses: actions/upload-artifact@v3
# Upload all test reports only on failure, because the artifacts are large
if: failure()
with:
name: result ${{ env.ARTIFACT_NAME }}
path: |
**/target/surefire-reports
**/target/checkstyle-*
- name: Upload test report
uses: actions/upload-artifact@v3
# Always upload the test report for the annotate.yml workflow,
# but only the single XML file to keep the artifact small
if: always()
with:
# Name prefix is checked in the `Annotate checks` workflow
name: test report ${{ github.job }} (${{ env.ARTIFACT_NAME }})
path: |
**/surefire-reports/TEST-*.xml
retention-days: ${{ env.TEST_REPORT_RETENTION_DAYS }}
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository