Skip to content

Commit

Permalink
DAT-15809 (#439)
Browse files Browse the repository at this point in the history
* consume packages from GPM

* add env variables and profile for CORE and PRO in pom

* Update test.yml

---------

Co-authored-by: Sayali M <sayali@Sayalis-MacBook-Pro>
  • Loading branch information
sayaliM0412 and Sayali M authored Sep 18, 2023
1 parent abfe081 commit 029bef9
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 1 deletion.
189 changes: 188 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
build:
name: Build & Package
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LIQUIBOT_TOKEN: ${{ secrets.LIQUIBOT_PAT }}
GPM_USERNAME: "liquibot"
GPM_PASSWORD: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4

Expand All @@ -21,6 +26,48 @@ jobs:
java-version: 17
distribution: 'temurin'
cache: 'maven'
# look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v21
with:
repositories: |
[
{
"id": "liquibase",
"url": "https://maven.pkg.github.com/liquibase/liquibase",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-pro",
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
}
]
servers: |
[
{
"id": "liquibase-pro",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
},
{
"id": "liquibase",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
}
]
- name: Build and Package
run: mvn -B dependency:go-offline clean package -DskipTests=true
Expand Down Expand Up @@ -53,6 +100,9 @@ jobs:
os: [ ubuntu-latest, windows-latest ]
name: Test Java ${{ matrix.java }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
LIQUIBOT_TOKEN: ${{ secrets.LIQUIBOT_PAT }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
needs: build
steps:
- uses: actions/checkout@v4
Expand All @@ -64,6 +114,49 @@ jobs:
distribution: 'temurin'
cache: 'maven'

# look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v21
with:
repositories: |
[
{
"id": "liquibase",
"url": "https://maven.pkg.github.com/liquibase/liquibase",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-pro",
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
}
]
servers: |
[
{
"id": "liquibase-pro",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
},
{
"id": "liquibase",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
}
]
- uses: actions/download-artifact@v3
with:
name: ${{needs.build.outputs.artifact_id}}-artifacts
Expand All @@ -84,6 +177,9 @@ jobs:
integration-tests:
name: Integration Test - Java ${{ matrix.java }}
runs-on: ubuntu-latest
env:
LIQUIBOT_TOKEN: ${{ secrets.LIQUIBOT_PAT }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
needs: unit-test
strategy:
matrix:
Expand All @@ -104,12 +200,60 @@ jobs:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'

# look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v21
with:
repositories: |
[
{
"id": "liquibase",
"url": "https://maven.pkg.github.com/liquibase/liquibase",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-pro",
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
}
]
servers: |
[
{
"id": "liquibase-pro",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
},
{
"id": "liquibase",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
}
]
- name: Integration Test - Java ${{ matrix.java }}
run: mvn -B clean test verify -Prun-its --file pom.xml

harness-tests:
name: Harness Tests - Java ${{ matrix.java }}
runs-on: ubuntu-latest
env:
LIQUIBOT_TOKEN: ${{ secrets.LIQUIBOT_PAT }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
strategy:
matrix:
java: [ 11, 17 ]
Expand All @@ -124,6 +268,49 @@ jobs:
distribution: 'temurin'
cache: 'maven'

# look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v21
with:
repositories: |
[
{
"id": "liquibase",
"url": "https://maven.pkg.github.com/liquibase/liquibase",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-pro",
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
}
]
servers: |
[
{
"id": "liquibase-pro",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
},
{
"id": "liquibase",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
}
]
- name: Build Cache
uses: actions/[email protected]
with:
Expand All @@ -149,4 +336,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: mongodb-test-results
path: build/spock-reports
path: build/spock-reports
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,32 @@
</distributionManagement>

<profiles>
<profile>
<id>remote-repositories</id>
<activation>
<property>
<name>env.CI</name>
<value>true</value>
</property>
</activation>
<repositories>
<repository>
<id>liquibase</id>
<url>https://maven.pkg.github.com/liquibase/liquibase</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>liquibase-pro</id>
<url>https://maven.pkg.github.com/liquibase/liquibase-pro</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>

<profile>
<id>coverage</id>
<activation>
Expand Down

0 comments on commit 029bef9

Please sign in to comment.