-
Notifications
You must be signed in to change notification settings - Fork 116
131 lines (123 loc) · 3.71 KB
/
build.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Copyright 2023, Gerwin Klein, Régis Décamps, Steve Rowe
# SPDX-License-Identifier: BSD-3-Clause
name: Build
on:
push:
branches:
- master
pull_request:
env:
PUBLISH_SOURCES: 'true'
jobs:
build:
name: 'Maven & Examples'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: [ 8, 11, 17 ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: zulu
cache: maven
- name: '🔨 Maven (build, test)'
run: scripts/test-unit.sh
- name: '🔨 Maven (site)'
run: scripts/mvn-site.sh
- name: '🔨 Maven (aggregate sources)'
run: scripts/mvn-aggregate-srcs.sh
- name: '😎 Examples (mvn, ant, make)'
run: scripts/test-examples.sh
bazel:
name: 'Bazel'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/bazel
# We store new cache content for each new commit sha, but load the cache
# from any last run, because bazel is fairly good at figuring out diffs.
# Per GitHub policy, PRs will only get caches from the base branch, not
# from each other, and the base branch will not see the cache from PRs.
key: ${{ runner.os }}-bazel-${{ github.sha }}
restore-keys: |
${{ runner.os }}-bazel-
- name: 'Info'
run: bazel --bazelrc=.ci.bazelrc info release
- name: 'Unit Tests'
run: bazel --bazelrc=.ci.bazelrc test //jflex/...
- name: 'Integration+Regression Tests'
run: bazel --bazelrc=.ci.bazelrc test //javatests/...
- name: 'Build all'
run: bazel --bazelrc=.ci.bazelrc build //...
- name: 'Test all'
run: bazel --bazelrc=.ci.bazelrc test //...
- name: 'Build artifact'
run: bazel --bazelrc=.ci.bazelrc build jflex/jflex_bin_deploy.jar
- name: 'Check aggregated sources'
run: |
bazel --bazelrc=.ci.bazelrc build //jflex:jflex_bin_deploy-src.jar //jflex:resources
mkdir -p jflex_bin_deploy; cd jflex_bin_deploy
cp ../scripts/compile-aggregated-java-sources.sh compile.sh
jar -xf ../bazel-bin/jflex/jflex_bin_deploy-src.jar
jar -xf ../bazel-bin/jflex/libresources.jar
./compile.sh
ls jflex/Main.class
regression:
name: 'Regression'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: [ 8, 11, 17 ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: zulu
cache: maven
- name: '📝 Regression tests'
run: |
scripts/mvn-install-fastbuild.sh jflex-maven-plugin,testsuite/jflex-testsuite-maven-plugin
scripts/test-regression.sh
javadoc:
name: Javadoc
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11, 17 ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: zulu
cache: maven
- name: '🔨 Build JFlex jar'
run: |
mvn -Pfastbuild install
- name: '📝 Javadoc'
run: |
mvn javadoc:javadoc
docs:
name: 'Docs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Install LaTeX and pandoc'
run: |
sudo apt-get install \
pandoc pandoc-citeproc texlive texlive-latex-extra lmodern
- name: "📄 Documentation"
run: cd docs; make