Use a compatible graddle version #1
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | |
name: Test and Build Test Versions | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "*" ] | |
permissions: | |
contents: read | |
checks: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
unittests: | |
name: Build and run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build with Gradle | |
run: ./gradlew test | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() # always run even if the previous step fails | |
with: | |
report_paths: '**/build/test-results/test/TEST-*.xml' | |
- name: Upload build reports | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: unitests-build-reports | |
path: build/reports/ | |
- name: Upload package | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-package | |
path: build/distributions/*.tar.gz | |
epicstests: | |
name: Run all unit tests reliant on EPICS install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Create Build Reports Folder | |
run: mkdir -p build/reports/tests | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Run tests with docker compose | |
run: docker compose -f docker/docker-compose.epicsTests.yml run epicsarchiver-test | |
env: | |
DOCKER_DEFAULT_PLATFORM: linux/amd64 | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
DOCKER_BUILDKIT: 1 | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() # always run even if the previous step fails | |
with: | |
report_paths: '**/build/test-results/epicsTests/TEST-*.xml' | |
- name: Upload build reports | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: epicstests-build-reports | |
path: build/reports/ | |
build-custom-version: | |
needs: [unittests, epicstests] | |
name: Build Slacdev and Default site version | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
siteid: ["slacdev", "default", "tests"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build with Gradle | |
run: ./gradlew assemble | |
env: | |
ARCHAPPL_SITEID: ${{ matrix.siteid }} | |
- name: Upload package | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.siteid }}-package | |
path: build/distributions/*.tar.gz |