Repository navigation
106 lines (101 loc) · 3.81 KB
/
Copy pathjtreg.yml
File metadata and controls
106 lines (101 loc) · 3.81 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
name: jtreg
# The OpenJDK regression tests in test/jtreg/passing.txt, split over parallel
# jobs. A pull request runs the tests its changes need; `full` runs them all.
on:
workflow_call:
inputs:
full:
type: boolean
default: false
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-latest
outputs:
filters: ${{ steps.select.outputs.filters }}
shards: ${{ steps.select.outputs.shards }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: 26
- id: select
env:
FULL: ${{ inputs.full }}
BASE: ${{ github.event.pull_request.base.sha }}
# a pull request runs what its diff needs; anything else runs everything
run: |
if [ "$FULL" = true ] || [ -z "$BASE" ]; then arg=--full; else arg=$BASE; fi
node scripts/jtreg/select.ts "$arg" >> "$GITHUB_OUTPUT"
run:
needs: plan
if: needs.plan.outputs.shards != '[]'
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
shard: ${{ fromJSON(needs.plan.outputs.shards) }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: pnpm/action-setup@v6
with:
version: 12
- uses: actions/setup-node@v7
with:
node-version: 26
cache: pnpm
- uses: actions/cache@v6
with:
# the downloads build-jdk.sh keeps; boot snapshots there stay out
path: |
~/.cache/java-web/jdk-*
~/.cache/java-web/dejavu-*
key: jdk-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/build-jdk.sh') }}
# TestNG and JUnit, which scripts/jtreg/run.ts fetches from Maven Central
- uses: actions/cache@v6
with:
path: build/jtreg/lib
key: jtreg-lib-${{ hashFiles('scripts/jtreg/run.ts') }}
- run: pnpm install --frozen-lockfile
- run: pnpm jdk
# each test VM starts from the bundle, which loads faster than src/
- run: pnpm build
- name: OpenJDK regression tests
env:
FILTERS: ${{ needs.plan.outputs.filters }}
run: |
release=$(sed -n 's/^release=//p' scripts/build-jdk.sh)
git clone -q --filter=blob:none --sparse --depth 1 --branch "jdk-${release%+*}-ga" https://github.com/openjdk/jdk25u.git build/ref/jdk25u
dirs=$(grep -v '^#' test/jtreg/passing.txt | cut -d/ -f1-2 | sort -u | sed 's|^|test/jdk/|')
git -C build/ref/jdk25u sparse-checkout set test/lib test/jdk/lib test/jdk/tools/lib \
src/java.base/share/data/lsrdata src/java.base/share/data/unicodedata $dirs
# the @library directories of the listed tests, which can lie outside those
git -C build/ref/jdk25u sparse-checkout add $(node scripts/jtreg/run.ts build/ref/jdk25u --only-passing --library-dirs)
read -ra filters <<< "$FILTERS"
node scripts/jtreg/run.ts build/ref/jdk25u --only-passing --jobs 4 --timeout 600 --vm dist/node.js \
--shard ${{ matrix.shard }}/${{ strategy.job-total }} "${filters[@]}"
# each test's run time, for refreshing test/jtreg/times.tsv
- uses: actions/upload-artifact@v7
if: always()
with:
name: times-${{ matrix.shard }}
path: build/jtreg/times.tsv
if-no-files-found: ignore
retention-days: 30
# one check for branch protection, whatever the number of shards
result:
needs: [plan, run]
if: always()
runs-on: ubuntu-latest
steps:
- env:
PLAN: ${{ needs.plan.result }}
RUN: ${{ needs.run.result }}
run: test "$PLAN" = success && { test "$RUN" = success || test "$RUN" = skipped; }