Skip to content

test: Add comprehensive JDBC tests with Oracle and H2 support #108

test: Add comprehensive JDBC tests with Oracle and H2 support

test: Add comprehensive JDBC tests with Oracle and H2 support #108

Workflow file for this run

name: Build and test
on: [push]
permissions:
# The GITHUB_TOKEN is used to download AppMap service
# binaries in addition to cloning the repository; by explicitly
# setting permissions, we ensure it has no unnecessary access.
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-check:
name: Build and check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v4
if: ${{ github.ref == 'refs/heads/master' }}
- name: Build, check and test
run: ./gradlew shadowJar annotation:jar check integrationTest
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Jars
path: |
agent/build/libs/*.jar
annotation/build/libs/*.jar
test-suite:
services:
oracle:
image: docker.io/gvenzl/oracle-free:slim-faststart
ports:
- 1521:1521
env:
ORACLE_PASSWORD: oracle
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
java: ['21', '17', '11', '8']
runs-on: ubuntu-latest
name: Run test suite with Java ${{ matrix.java }}
needs: build-and-check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
name: Set up Java
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Suid root tar
# Required for the bats libraries cache to restore properly
run: sudo chmod +s /bin/tar
- name: Setup Bats and bats libs
id: setup-bats
uses: bats-core/bats-action@3.0.0
- name: Remove suid root tar
run: sudo chmod -s /bin/tar
- uses: sbt/setup-sbt@v1
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Jars
- name: Clone test projects
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TERM: xterm
working-directory: ./agent
run: bin/test_projects
- uses: actions/setup-java@v4
name: Set up Gradle cache
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: gradle
- uses: actions/setup-java@v4
name: Set up Maven cache
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
- uses: actions/setup-java@v4
name: Set up sbt cache
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: sbt
- name: Build test projects
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TERM: xterm
working-directory: ./agent
run: bin/test_install
- name: Run tests
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TERM: xterm
# Github token is just to avoid rate limiting when IntelliJ tests
# are run and download the AppMap service binaries
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORACLE_URL: jdbc:oracle:thin:@localhost:1521
ORACLE_USERNAME: system
ORACLE_PASSWORD: oracle
working-directory: ./agent
run: bin/test_run