Use of myMinJavaVersion and myTessdataTag from gradle.properties #65
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 & Test Audiveris | |
# execute this workflow on every push | |
on: | |
- push | |
permissions: | |
contents: read | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
env: | |
TESSDATA_PREFIX: /home/runner/work/audiveris/audiveris/tessdata | |
# Hard-coded value has been removed, was TESSDATA_TAG: 4.1.0 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Retrieve Gradle properties | |
uses: BrycensRanch/read-properties-action@v1 | |
id: all | |
with: | |
file: gradle.properties | |
all: true | |
- name: Setup Java ${{ steps.all.outputs.myMinJavaVersion }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ steps.all.outputs.myMinJavaVersion }} | |
distribution: zulu | |
- name: Set environment variable(s) | |
run: | | |
echo "TESSDATA_TAG=${{ steps.all.outputs.myTessdataTag }}" >> $GITHUB_ENV | |
- name: Test environment variable | |
run: | | |
echo "TESSDATA_TAG: ${{ env.TESSDATA_TAG }}" | |
# cache loaded tessdata files so they don't have to be re-downloaded on every workflow execution | |
- name: Get cached tessdata files | |
id: cache-tessdata | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.TESSDATA_PREFIX }} | |
key: ${{ runner.os }}-tessdata-${{ env.TESSDATA_TAG }}-eng-deu-fra-ita | |
- name: Install tessdata files | |
if: steps.cache-tessdata.outputs.cache-hit != 'true' | |
run: | | |
${GITHUB_WORKSPACE}/.github/install-tessdata.sh eng && | |
${GITHUB_WORKSPACE}/.github/install-tessdata.sh deu && | |
${GITHUB_WORKSPACE}/.github/install-tessdata.sh fra && | |
${GITHUB_WORKSPACE}/.github/install-tessdata.sh ita | |
- name: Build Audiveris | |
uses: gradle/[email protected] | |
with: | |
arguments: build -x test | |
- name: Unit-Test Audiveris | |
uses: gradle/[email protected] | |
with: | |
arguments: test |