Skip to content

#594: Customize Java versions in GitHub workflows #1187

#594: Customize Java versions in GitHub workflows

#594: Customize Java versions in GitHub workflows #1187

Workflow file for this run

name: Test on windows
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: windows-latest
permissions:
contents: read
defaults:
run:
shell: "bash"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDKs
uses: actions/setup-java@v4
with:
distribution: "temurin"
# Java 11 required for test project "my-test-project"
java-version: |
11
17
cache: "maven"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Go tools
run: go install github.com/google/[email protected]
- name: Build and install
run: mvn --batch-mode -T 1C -DtrimStackTrace=false clean install
- name: Run project-keeper itself
id: build-pk-verify
run: mvn --batch-mode -DtrimStackTrace=false com.exasol:project-keeper-maven-plugin:verify --projects .
- name: Verify Release Artifacts
run: |
print_message() {
local -r message=$1
echo "$message"
echo "$message" >> "$GITHUB_STEP_SUMMARY"
}
print_message "### Release Artifacts"
IFS=$'\n' artifacts_array=($ARTIFACTS)
missing_files=()
for file in "${artifacts_array[@]}";
do
echo "Checking if file $file exists..."
if ! [[ -f "$file" ]]; then
print_message "* ⚠️ \`$file\` does not exist ⚠️"
echo "Content of directory $(dirname "$file"):"
ls "$(dirname "$file")"
missing_files+=("$file")
else
print_message "* \`$file\` ✅"
fi
done
print_message ""
number_of_missing_files=${#missing_files[@]}
if [[ $number_of_missing_files -gt 0 ]]; then
print_message "⚠️ $number_of_missing_files release artifact(s) missing ⚠️"
exit 1
fi
env:
ARTIFACTS: ${{ steps.build-pk-verify.outputs.release-artifacts }}