Merge commit '55b5b33e572f16b6e9c15e123caab2b0bdc3dfb7' #296
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04, windows-latest, macos-latest ] | |
java: [ '11', '17', '21' ] | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} - Java ${{ matrix.java }} build test | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Setup Environment (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install language-pack-ja-base language-pack-ja | |
sudo update-locale LANG=ja_JP.UTF8 | |
sudo apt-get -y install fonts-noto* language-selector-common | |
export LANG=ja_JP.UTF-8 | |
fc-cache -f | |
fc-match Dialog | grep "Noto Sans CJK JP" | |
sudo apt-get -y install graphviz | |
# for GitHub Actions test | |
sudo apt-get -y install poppler-utils | |
- name: Setup Environment (macOS) | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
brew install graphviz | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
- name: Build with Gradle (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
# Check font settings | |
export LANG=ja_JP.UTF-8 | |
fc-match Dialog | grep "Noto Sans CJK JP" | |
## Workaround to suppress warnings from JRuby in JDK 17 or later (https://github.com/jruby/jruby/issues/6721) | |
## export JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" | |
# create document | |
./gradlew docs | |
# output unused images and test Gradle task | |
./gradlew -q checkSyncImage | |
- name: Build with Gradle (macOS) | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
## Workaround to suppress warnings from JRuby in JDK 17 or later (https://github.com/jruby/jruby/issues/6721) | |
## export JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" | |
# create document | |
./gradlew docs | |
# output unused images and test Gradle task | |
./gradlew -q checkSyncImage | |
- name: Build with Gradle (Windows) | |
if: startsWith(matrix.os, 'windows') | |
shell: pwsh | |
run: | | |
## Workaround to suppress warnings from JRuby in JDK 17 or later (https://github.com/jruby/jruby/issues/6721) | |
## $env:JDK_JAVA_OPTIONS = "--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" | |
# create document | |
.\gradlew docs | |
# output unused images and test Gradle task | |
.\gradlew -q checkSyncImage | |
- name: Check | |
shell: bash | |
run: | | |
find docs/ -type f -ls | |
find docs/ -type f -ls | wc | |
# test asciidoctor-diagram (If you are not using diagram, comment out the next line) | |
find docs/ -type f -ls | egrep 'svg$' | |
# test asciidoctor | |
file docs/index.pdf | grep PDF | |
file docs/index.html | grep HTML | |
- name: Output PDF information (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
echo "# PDF information" | |
./gradlew -q checkPdfInfo | |
echo "# URLs in document" | |
pdfinfo -url docs/index.pdf | tail -n +2 | awk '{ print $3 }' | sort | uniq | |
- name: Output PDF information (Windows) | |
if: startsWith(matrix.os, 'windows') | |
shell: pwsh | |
run: | | |
echo "# PDF information" | |
.\gradlew -q checkPdfInfo | |
- name: Output PDF information (macOS) | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
echo "# PDF information" | |
./gradlew -q checkPdfInfo |