forked from mozilla/rhino
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (103 loc) · 3.81 KB
/
gradle.yml
File metadata and controls
108 lines (103 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
107
108
name: Rhino CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
permissions: read-all
env:
GRADLE_OPTS: "--enable-native-access=ALL-UNNAMED"
jobs:
# First, "official" test: Build on Java 25, test on Java 11, compare test262.properties
# to see if tests are passing that are currently disabled.
test:
runs-on: ubuntu-latest
name: Test 262 Verification
steps:
- name: Check out Rhino
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2
- name: Check out test262
run: git submodule update --init --single-branch
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: |
11
25
distribution: 'adopt'
- name: Check current state of test262.properties
id: hashBefore
run: echo "hash=${{ hashFiles('./tests/testsrc/test262.properties') }}" >> $GITHUB_OUTPUT
- name: Run test262 tests
# Currently Java 11 is required to have a reproducible result
env:
RHINO_TEST_JAVA_VERSION: "11"
run: >-
./gradlew check -DupdateTest262properties
- name: Upload results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: ${{ always() }}
with:
name: reports-java
path: '*/build/reports'
- name: Check updated state of test262.properties
id: hashAfter
run: echo "hash=${{ hashFiles('./tests/testsrc/test262.properties') }}" >> $GITHUB_OUTPUT
- name: Compare test262 results
run: |
if [ "${{ steps.hashBefore.outputs.hash }}" != "${{ steps.hashAfter.outputs.hash }}" ]; then
echo "The test262.properties file was not updated properly."
echo "Please follow the instructions in tests/README.md to update it."
git --no-pager diff ./tests/testsrc/test262.properties
exit 1
else
echo "The test262.properties file is up to date."
fi
# Test various combinations of building and testing
matrix-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- java-version: "21"
test-java-version: "21"
name: "Java 21 Build and Test"
multithread: false
- java-version: "25"
test-java-version: "25"
name: "Java 25 Build and Test"
multithread: false
- java-version: "25"
test-java-version: "25"
name: "Java 25 Multithreaded"
multithread: true
- java-version: "25"
test-java-version: "17"
name: "Java 25 Build, Java 17 Test"
multithread: false
name: ${{ matrix.name }}
steps:
- name: Check out Rhino
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2
- name: Check out test262
run: git submodule update --init --single-branch
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: |
${{ matrix.test-java-version }}
${{ matrix.java-version }}
distribution: 'adopt'
- name: Build and test ${{ matrix.name }}
env:
RHINO_TEST_JAVA_VERSION: ${{ matrix.test-java-version }}
run: >-
./gradlew check ${{ matrix.multithread && '-Drhino.useThreadSafeObjectsByDefault=true' || '' }}
- name: Upload results ${{ matrix.name }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: ${{ always() }}
with:
name: reports-java-${{ matrix.java-version }}-${{ matrix.test-java-version}}${{ matrix.multithread }}
path: '*/build/reports'