Changeset: 3cc14141e503 for monetdb-java URL: https://dev.monetdb.org/hg/monetdb-java/rev/3cc14141e503 Added Files: .github/workflows/testjars.yml Removed Files: .github/workflows/jdkversions.yml .github/workflows/macos.yml .github/workflows/monetdbversions.yml Branch: mvn Log Message:
Rewrite GitHub Actions Replace the three workflows with a single one which builds the jars in one job and tests those with a number of platforms and monetdb versions in other jobs. diffs (truncated from 344 to 300 lines): diff --git a/.github/workflows/jdkversions.yml b/.github/workflows/jdkversions.yml deleted file mode 100644 --- a/.github/workflows/jdkversions.yml +++ /dev/null @@ -1,63 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -# or https://github.com/actions/checkout and https://github.com/actions/setup-java - -# Note: Oracle JDK is only supported for JDK 17, 21 and later - -name: Test with various JDK versions - -on: [push] - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - distribution: - - liberica - - oracle - java_version: - - 8 - - 11 - - 17 - - 21 - - 22 - - 23 - exclude: - - distribution: oracle - java_version: 8 - - distribution: oracle - java_version: 11 - - services: - monetdb_container: - image: monetdb/dev-builds:Aug2024 - env: - MDB_DAEMON_PASS: monetdb - MDB_DB_ADMIN_PASS: monetdb - ports: - - 50000:50000 - - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java_version }} - distribution: ${{ matrix.distribution }} - - - name: Build - run: make - - - name: Create jar symlink - run: ln -s monetdb-jdbc*.jar monetdb-jdbc.jar - working-directory: jars - - - name: Run JDBC_API_Tester - run: java -cp jars/monetdb-jdbc.jar:jars/jdbctests.jar JDBC_API_Tester 'jdbc:monetdb://localhost:50000/monetdb?user=monetdb&password=monetdb' - - - name: Run OnClientTester - run: java -cp jars/monetdb-jdbc.jar:jars/jdbctests.jar OnClientTester 'jdbc:monetdb://localhost:50000/monetdb?user=monetdb&password=monetdb' -v diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,34 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -# or https://github.com/actions/checkout and https://github.com/actions/setup-java - -name: MacOS - -on: [push] - -jobs: - build: - - runs-on: macos-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 1.8 - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: liberica - - - name: Build - run: make - - - name: Create jar symlink - run: ln -s monetdb-jdbc*.jar monetdb-jdbc.jar - working-directory: jars - -# running java test programs fails, due to failed connection. Probably the server was not started. Assistance needed. -# - name: Run JDBC_API_Tester -# run: java -cp jars/monetdb-jdbc.jar:jars/jdbctests.jar JDBC_API_Tester 'jdbc:monetdb://localhost:50000/monetdb?user=monetdb&password=monetdb' - -# - name: Run OnClientTester -# run: java -cp jars/monetdb-jdbc.jar:jars/jdbctests.jar OnClientTester 'jdbc:monetdb://localhost:50000/monetdb?user=monetdb&password=monetdb' -v diff --git a/.github/workflows/monetdbversions.yml b/.github/workflows/monetdbversions.yml deleted file mode 100644 --- a/.github/workflows/monetdbversions.yml +++ /dev/null @@ -1,53 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -# or https://github.com/actions/checkout and https://github.com/actions/setup-java - -name: Test with various MonetDB versions - -on: [push] - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - monetdbversion: - - "monetdb/dev-builds:Jan2022" - - "monetdb/dev-builds:Sep2022" - - "monetdb/dev-builds:Jun2023" - - "monetdb/dev-builds:Dec2023" - - "monetdb/dev-builds:Aug2024" - - "monetdb/dev-builds:default" - - services: - monetdb_container: - image: ${{ matrix.monetdbversion }} - env: - MDB_DAEMON_PASS: monetdb - MDB_DB_ADMIN_PASS: monetdb - ports: - - 50000:50000 - - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: liberica - - - name: Build - run: make - - - name: Create jar symlink - run: ln -s monetdb-jdbc*.jar monetdb-jdbc.jar - working-directory: jars - - - name: Run JDBC_API_Tester - run: java -cp jars/monetdb-jdbc.jar:jars/jdbctests.jar JDBC_API_Tester 'jdbc:monetdb://localhost:50000/monetdb?user=monetdb&password=monetdb' - - - name: Run OnClientTester - run: java -cp jars/monetdb-jdbc.jar:jars/jdbctests.jar OnClientTester 'jdbc:monetdb://localhost:50000/monetdb?user=monetdb&password=monetdb' -v diff --git a/.github/workflows/testjars.yml b/.github/workflows/testjars.yml new file mode 100644 --- /dev/null +++ b/.github/workflows/testjars.yml @@ -0,0 +1,174 @@ +# This workflow builds the jdbc jar on Linux and tries to run the tests on +# Linux, macOS and Windows. + +name: test jars + +on: + push: + +jobs: + + # This job builds the jars for use by the other jobs. + # It quickly tests against MonetDB and tlstester instances running in a container. + build_jar: + runs-on: ubuntu-latest + env: + MONETDB_TLSTESTER: localhost:4300 + steps: + + - uses: actions/checkout@v4 + + # Skip all other steps if pom.xml and src/ haven't changed. + # You can increment the xyz component of the cache key to invalidate + # any existing cache and run everything anew. + - name: Cache the whole job + uses: actions/cache@v4 + id: cache-all + with: + path: jars + key: xyz6-${{ runner.os }}-${{ hashFiles('src', 'pom.xml') }} + + # We start the containers manually rather than using GitHub's Service + # Container feature because we don't want to spend time starting the + # containers if job 'cache-all' above already has everything cached. + - name: Start containers + if: (!steps.cache-all.outputs.cache-hit) + run: | + docker run -d -e MDB_DB_ADMIN_PASS=monetdb -e MDB_CREATE_DBS=jdbctest -p 50000:50000 docker.io/monetdb/dev-builds:Aug2024 + docker run -d -e TLSTEST_DOMAIN=localhost -p 4300-4350:4300-4350 docker.io/monetdb/tlstester:0.3.1 + + - name: Cache Maven downloads + if: (!steps.cache-all.outputs.cache-hit) + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - uses: actions/setup-java@v4 + if: (!steps.cache-all.outputs.cache-hit) + with: + java-version: 24 + distribution: oracle + + - name: Build and test + if: (!steps.cache-all.outputs.cache-hit) + run: ./mvnw --no-transfer-progress package -Dgroups='!slow' + + - uses: actions/upload-artifact@v4 + with: + name: jars + path: jars + retention-days: 1 + + + + + # This job tests the jars on various platforms, always against the latest + # MonetDB because MonetDB/[email protected] can only fairly recent versions. + platform: + needs: build_jar + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + java: # not sure, let's test with 8 and the latest + - 8 + - 24 + include: + # override java-dist only for java 8 + - java: 8 + java-dist: liberica + runs-on: ${{ matrix.os }} + steps: + + - uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: ${{ matrix.java-dist || 'oracle' }} + + - uses: actions/download-artifact@v4 + with: + name: jars + path: jars + + - run: ls -lh jars + shell: bash + + - uses: MonetDB/[email protected] + with: + version: Latest + + - name: Run tests + run: | + java -cp jars/'*' JDBC_API_Tester -v jdbc:monetdb:///demo + + + + + oldmonetdb: + needs: build_jar + strategy: + fail-fast: false + matrix: + monetdb: + - Jan2022 + - Sep2022 + - Jun2023 + - Dec2023 + - Aug2024 +# - default + runs-on: ubuntu-latest + services: + monetdb: + image: monetdb/dev-builds:${{ matrix.monetdb }} + env: + MDB_DAEMON_PASS: monetdb _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
