-
Notifications
You must be signed in to change notification settings - Fork 3k
106 lines (99 loc) · 3.95 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
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@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
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: ./.github/actions/setup
timeout-minutes: 10
- 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: ./.github/actions/setup
timeout-minutes: 10
- 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
id: 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: ./.github/actions/process-test-results
if: always()
with:
artifact-name: ${{ env.ARTIFACT_NAME }}
has-failed-tests: ${{ steps.tests.outcome == 'failure' }}
- 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