Repository navigation
115 lines (110 loc) · 3.85 KB
/
Copy pathjava.yml
File metadata and controls
115 lines (110 loc) · 3.85 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
109
110
111
112
113
114
115
name: Java
on:
push:
paths:
- 'java/**'
- 'conformance/**'
- 'formats/**'
- 'rust/**'
- 'site/src/content/docs/using/java.mdx'
- '.github/workflows/java.yml'
pull_request:
paths:
- 'java/**'
- 'conformance/**'
- 'formats/**'
- 'rust/**'
- 'site/src/content/docs/using/java.mdx'
- '.github/workflows/java.yml'
permissions:
contents: read
concurrency:
group: java-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# ./gradlew build runs the style checks, every test, the whole conformance
# suite through the Rust runner, and the API reference, so each job needs Rust.
# It compiles and tests iris-jmh but runs no benchmarks.
jobs:
build:
name: Build (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: bash
working-directory: java
steps:
# The conformance cases compare bytes, so check them out with LF.
- name: Keep line endings
if: runner.os == 'Windows'
working-directory: .
run: git config --global core.autocrlf false
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '27'
cache: gradle
cache-dependency-path: |
java/**/*.gradle.kts
java/gradle/libs.versions.toml
java/gradle/wrapper/gradle-wrapper.properties
- uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo artifacts
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: java-cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust/Cargo.lock', 'rust/rust-toolchain.toml') }}-${{ hashFiles('rust/**/*.rs', 'rust/**/Cargo.toml') }}
restore-keys: |
java-cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust/Cargo.lock', 'rust/rust-toolchain.toml') }}-
- name: Build and test
run: ./gradlew build
- name: Upload test reports
if: failure()
uses: actions/upload-artifact@v6
with:
name: java-test-reports-${{ matrix.os }}
path: java/*/build/reports/tests/
# Generates a Java builder program for every accepted corpus spec, checks it
# with google-java-format through Spotless, compiles every program in one
# javac run with Error Prone and the warnings as errors, runs them, and
# compares the spec each prints with the original.
builder-round-trip:
name: Builder round trip
runs-on: ubuntu-24.04
timeout-minutes: 60
defaults:
run:
shell: bash
working-directory: rust
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '27'
cache: gradle
cache-dependency-path: |
java/**/*.gradle.kts
java/gradle/libs.versions.toml
java/gradle/wrapper/gradle-wrapper.properties
- uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo artifacts
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: java-round-trip-cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust/Cargo.lock', 'rust/rust-toolchain.toml') }}-${{ hashFiles('rust/**/*.rs', 'rust/**/Cargo.toml') }}
restore-keys: |
java-round-trip-cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust/Cargo.lock', 'rust/rust-toolchain.toml') }}-
- name: Round trip
run: cargo test --locked -p gecode-iris --test builder_round_trip_java -- --ignored --nocapture