Skip to content

Commit

Permalink
restrict workflow size for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
evanchooly committed Feb 23, 2024
1 parent 9dac2dd commit 612216f
Showing 1 changed file with 142 additions and 142 deletions.
284 changes: 142 additions & 142 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,118 +9,118 @@ on:
workflow_dispatch:

jobs:
CodeAudits:
uses: evanchooly/workflows/.github/workflows/code-audits.yml@master
with:
java: 17
# CodeAudits:
# uses: evanchooly/workflows/.github/workflows/code-audits.yml@master
# with:
# java: 17

Build:
uses: evanchooly/workflows/.github/workflows/build.yml@master
with:
java: 17
saveBuild: true

Matrix:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
server-id: central
cache: maven

- name: Setup JBang
uses: jbangdev/setup-jbang@main

- name: Find MongoDB versions
id: mongo-versions
run: |
echo "mongo_versions=$( jbang .github/BuildMatrix.java )" >> $GITHUB_OUTPUT
- name: Find Latest Driver version
id: latest-driver-version
run: |
echo "latest_driver_version=$( jbang .github/DriverVersions.java latest)" >> $GITHUB_OUTPUT
- name: Find Driver versions
id: driver-versions
run: |
echo "driver_versions=$( jbang .github/DriverVersions.java all)" >> $GITHUB_OUTPUT
- name: Is releasable branch
id: releasable
run: |
if [ "${{ github.event.ref }}" == 'refs/heads/master' ] \
|| [ "${{ github.event.ref }}" == 'refs/heads/main' ] \
|| [[ "${{ github.event.ref }}" =~ ^refs/heads/[0-9]+\.[0-9]+\.x$ ]] \
|| [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+.[0-9]+$ ]]
then
echo "releasable=true" >> $GITHUB_OUTPUT
else
echo "releasable=false" >> $GITHUB_OUTPUT
fi
- name: Find Driver snapshot version
id: driver-snapshot
run: |
echo "driver_snapshot=$( jbang .github/DriverSnapshot.java )" >> $GITHUB_OUTPUT
outputs:
driver_latest: ${{ steps.latest-driver-version.outputs.latest_driver_version }}
driver_matrix: ${{ steps.driver-versions.outputs.driver_versions }}
version_matrix: ${{ steps.mongo-versions.outputs.mongo_versions }}
releasable: ${{ steps.releasable.outputs.releasable }}
driver_snapshot: ${{ steps.driver-snapshot.outputs.driver_snapshot }}

ServerTests:
name: Server
needs:
- Build
- Matrix
strategy:
fail-fast: false
matrix:
mongo: ${{ fromJson(needs.matrix.outputs.version_matrix) }}
driver: ${{ fromJson(needs.matrix.outputs.driver_latest) }}
java: [ 17 ]
uses: evanchooly/workflows/.github/workflows/build.yml@master
with:
java: ${{ matrix.java }}
reuseBuild: true
archive-name: "${{matrix.mongo}}-${{matrix.driver}}-${{matrix.java}}-${{github.run_id}}"
maven-flags: "-e -Dmongodb=${{ matrix.mongo }} -Ddriver.version=${{ matrix.driver }}"

DriversTests:
name: Driver
needs:
- Build
- Matrix
strategy:
fail-fast: false
matrix:
driver: ${{ fromJson(needs.matrix.outputs.driver_matrix) }}
java: [ 17 ]
mongo: [ 7 ]
include:
- driver: ${{ fromJson(needs.matrix.outputs.driver_latest)[0] }}
java: 21
mongo: 7
- driver: ${{ needs.matrix.outputs.driver_snapshot }}
java: 17
mongo: 7
optional: true
uses: evanchooly/workflows/.github/workflows/build.yml@master
with:
java: ${{ matrix.java }}
reuseBuild: true
archive-name: "${{matrix.mongo}}-${{matrix.driver}}-${{matrix.java}}-${{github.run_id}}"
maven-flags: "-e -Dmongodb=${{ matrix.mongo }} -Ddriver.version=${{ matrix.driver }}"
optional: ${{ matrix.optional == true }}
# Matrix:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Setup Java
# uses: actions/setup-java@v4
# with:
# java-version: 17
# distribution: 'temurin'
# server-id: central
# cache: maven
#
# - name: Setup JBang
# uses: jbangdev/setup-jbang@main
#
# - name: Find MongoDB versions
# id: mongo-versions
# run: |
# echo "mongo_versions=$( jbang .github/BuildMatrix.java )" >> $GITHUB_OUTPUT
#
# - name: Find Latest Driver version
# id: latest-driver-version
# run: |
# echo "latest_driver_version=$( jbang .github/DriverVersions.java latest)" >> $GITHUB_OUTPUT
#
# - name: Find Driver versions
# id: driver-versions
# run: |
# echo "driver_versions=$( jbang .github/DriverVersions.java all)" >> $GITHUB_OUTPUT
#
# - name: Is releasable branch
# id: releasable
# run: |
# if [ "${{ github.event.ref }}" == 'refs/heads/master' ] \
# || [ "${{ github.event.ref }}" == 'refs/heads/main' ] \
# || [[ "${{ github.event.ref }}" =~ ^refs/heads/[0-9]+\.[0-9]+\.x$ ]] \
# || [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+.[0-9]+$ ]]
# then
# echo "releasable=true" >> $GITHUB_OUTPUT
# else
# echo "releasable=false" >> $GITHUB_OUTPUT
# fi
#
# - name: Find Driver snapshot version
# id: driver-snapshot
# run: |
# echo "driver_snapshot=$( jbang .github/DriverSnapshot.java )" >> $GITHUB_OUTPUT
#
# outputs:
# driver_latest: ${{ steps.latest-driver-version.outputs.latest_driver_version }}
# driver_matrix: ${{ steps.driver-versions.outputs.driver_versions }}
# version_matrix: ${{ steps.mongo-versions.outputs.mongo_versions }}
# releasable: ${{ steps.releasable.outputs.releasable }}
# driver_snapshot: ${{ steps.driver-snapshot.outputs.driver_snapshot }}

# ServerTests:
# name: Server
# needs:
# - Build
# - Matrix
# strategy:
# fail-fast: false
# matrix:
# mongo: ${{ fromJson(needs.matrix.outputs.version_matrix) }}
# driver: ${{ fromJson(needs.matrix.outputs.driver_latest) }}
# java: [ 17 ]
# uses: evanchooly/workflows/.github/workflows/build.yml@master
# with:
# java: ${{ matrix.java }}
# reuseBuild: true
# archive-name: "${{matrix.mongo}}-${{matrix.driver}}-${{matrix.java}}-${{github.run_id}}"
# maven-flags: "-e -Dmongodb=${{ matrix.mongo }} -Ddriver.version=${{ matrix.driver }}"

# DriversTests:
# name: Driver
# needs:
# - Build
# - Matrix
# strategy:
# fail-fast: false
# matrix:
# driver: ${{ fromJson(needs.matrix.outputs.driver_matrix) }}
# java: [ 17 ]
# mongo: [ 7 ]
# include:
# - driver: ${{ fromJson(needs.matrix.outputs.driver_latest)[0] }}
# java: 21
# mongo: 7
# - driver: ${{ needs.matrix.outputs.driver_snapshot }}
# java: 17
# mongo: 7
# optional: true
# uses: evanchooly/workflows/.github/workflows/build.yml@master
# with:
# java: ${{ matrix.java }}
# reuseBuild: true
# archive-name: "${{matrix.mongo}}-${{matrix.driver}}-${{matrix.java}}-${{github.run_id}}"
# maven-flags: "-e -Dmongodb=${{ matrix.mongo }} -Ddriver.version=${{ matrix.driver }}"
# optional: ${{ matrix.optional == true }}

UpgradeTests:
name: Upgrades
Expand All @@ -131,7 +131,7 @@ jobs:
strategy:
fail-fast: false
matrix:
morphia-branch: [ 2.4.x, 2.3.x, 2.2.x, 2.1.x, 2.0.x ]
morphia-branch: [ 2.4.x ] #, 2.3.x, 2.2.x, 2.1.x, 2.0.x ]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -159,45 +159,45 @@ jobs:
run: |
pwd
ls ~/ #morphia/.github
#ls ~/morphia/.github
ls ../.github
mvn install -DskipTests
for i in *
do
[ -e $i/src/main/java ] && rm -vrf $i/src/main/java
[ -e $i/src/main/kotlin ] && rm -vrf $i/src/main/kotlin
[ -e $i/target/generated-sources/ ] && rm -vrf $i/target/generated-sources/
[ -e $i/src/main/java ] && rm -rf $i/src/main/java
[ -e $i/src/main/kotlin ] && rm -rf $i/src/main/kotlin
[ -e $i/target/generated-sources/ ] && rm -rf $i/target/generated-sources/
done
mvn -Dmorphia.version=3.0.0-SNAPSHOT test
# mvn -Dmorphia.version=3.0.0-SNAPSHOT test
working-directory: upgrade-test

Release:
needs:
- Matrix
- CodeAudits
- ServerTests
- DriversTests
if: needs.Matrix.outputs.releasable == 'true'
uses: evanchooly/workflows/.github/workflows/jreleaser.yml@master
with:
java: 17
secrets:
GH_PUSH_TOKEN : ${{ secrets.GH_PUSH_TOKEN }}
GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
GPG_PUBLIC_KEY : ${{ secrets.GPG_PUBLIC_KEY }}
GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}

Docs:
name: Update Documentation
runs-on: ubuntu-latest
needs:
- Release
steps:
- name: Invoke antora build
uses: benc-uk/workflow-dispatch@v121
with:
workflow: Docs
repo: MorphiaOrg/morphia-docs
token: ${{ secrets.GH_PUSH_TOKEN }}
ref: refs/heads/master
# Release:
# needs:
# - Matrix
# - CodeAudits
# - ServerTests
# - DriversTests
# if: needs.Matrix.outputs.releasable == 'true'
# uses: evanchooly/workflows/.github/workflows/jreleaser.yml@master
# with:
# java: 17
# secrets:
# GH_PUSH_TOKEN : ${{ secrets.GH_PUSH_TOKEN }}
# GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
# GPG_PUBLIC_KEY : ${{ secrets.GPG_PUBLIC_KEY }}
# GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
# SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
# SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}

# Docs:
# name: Update Documentation
# runs-on: ubuntu-latest
# needs:
# - Release
# steps:
# - name: Invoke antora build
# uses: benc-uk/workflow-dispatch@v121
# with:
# workflow: Docs
# repo: MorphiaOrg/morphia-docs
# token: ${{ secrets.GH_PUSH_TOKEN }}
# ref: refs/heads/master

0 comments on commit 612216f

Please sign in to comment.