Repository navigation
66 lines (61 loc) · 2.5 KB
/
Copy pathci.yml
File metadata and controls
66 lines (61 loc) · 2.5 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
name: ci
on:
push:
branches: [main]
pull_request:
# Least privilege by default; jobs that need more request it explicitly.
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest, windows-latest]
# 17 is the declared minimum (`maven.compiler.release`); 21 and 25 are the LTS
# releases consumers are most likely to run it on.
java: ["17", "21", "25"]
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
# `package` runs every test, the examples included, before it builds the jar.
- run: mvn -B -ntp package
- name: CLI smoke test
shell: bash
run: |
echo '{"items":[{"id":"box","quantity":8,"dimensions":{"length":"50","width":"50","height":"50"}}],
"containers":[{"id":"carton","inner_dimensions":{"length":"100","width":"100","height":"100"}}]}' \
| java -jar target/packvium-*.jar > result.json
grep -q '"complete":true' result.json
# The release profile adds sources, javadoc and signing. Building it here, unsigned, keeps a
# javadoc error from being discovered for the first time by the tag that tries to publish.
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
distribution: temurin
java-version: "17"
cache: maven
- run: mvn -B -ntp -P release -Dgpg.skip package
# Fails a pull request that introduces a dependency with a known vulnerability or a
# licence the project has not accepted. With no runtime dependencies its usual answer is
# "nothing changed", which is the answer we want to keep true rather than assume.
dependency-review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
with:
fail-on-severity: low
comment-summary-in-pr: on-failure