-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ci and ci-report yml files as reusable workflow * Update README.md for ci and ci-report.yml --------- Co-authored-by: Sayali M <sayali@Sayalis-MacBook-Pro>
- Loading branch information
1 parent
871793d
commit 4732344
Showing
3 changed files
with
202 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: 'Continuous Integration - Report' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-report: | ||
name: Report Test Results | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download and Extract Artifacts | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
mvn -B liquibase-sdk:download-snapshot-artifacts \ | ||
-Dliquibase.sdk.repo=${{ github.repository }} \ | ||
-Dliquibase.sdk.runId=${{ github.event.workflow_run.id }} \ | ||
-Dliquibase.sdk.downloadDirectory=artifacts \ | ||
-Dliquibase.sdk.artifactPattern=* \ | ||
-Dliquibase.sdk.unzipArtifacts=true | ||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
commit: ${{ github.event.workflow_run.head_sha }} | ||
event_file: artifacts/Event File/event.json | ||
event_name: ${{ github.event.workflow_run.event }} | ||
junit_files: "artifacts/test-reports-*/**/*.xml" | ||
|
||
build-testing-comment: | ||
name: Add Build Testing Comment | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch != 'main' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Create "BUILD_TESTING" comment | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
mvn -B liquibase-sdk:set-pull-request-comment \ | ||
-Dliquibase.sdk.repo=${{ github.repository }} \ | ||
-Dliquibase.sdk.pr.newComment=BUILD_TESTING \ | ||
-Dliquibase.sdk.pr.definition=${{ github.event.workflow_run.head_branch }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
name: Continuous Integration | ||
|
||
# Job will run nightly at 02:05 EDT / 01:05 CDT | ||
# Time below is UTC | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Build & Package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Install liquibase-core 0-SNAPSHOT | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: mvn -B clean liquibase-sdk:install-snapshot -Dliquibase.sdk.branchSearch=MATCHING_BRANCHES,master | ||
|
||
- name: Build and Package | ||
run: mvn -B dependency:go-offline clean package -DskipTests=true | ||
|
||
- name: Save Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: liquibase-bigquery-artifacts | ||
path: | | ||
target/*.jar | ||
- name: Save Event File | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Event File | ||
path: ${{ github.event_path }} | ||
|
||
- name: Build Cache | ||
uses: actions/[email protected] | ||
with: | ||
key: build-${{ github.run_number }}-${{ github.run_attempt }} | ||
path: | | ||
**/target/** | ||
~/.m2/repository/org/liquibase/ | ||
unit-test: | ||
name: Test Java ${{ matrix.java }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java: [ 8, 11, 17, 18 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Build Cache | ||
uses: actions/[email protected] | ||
with: | ||
key: build-${{ github.run_number }}-${{ github.run_attempt }} | ||
path: | | ||
**/target/** | ||
~/.m2/repository/org/liquibase/ | ||
- name: Run Tests | ||
run: mvn -B jacoco:prepare-agent surefire:test | ||
|
||
- name: Archive Test Results | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-reports-jdk-${{ matrix.java }} | ||
path: | | ||
**/target/surefire-reports | ||
**/target/jacoco.exec | ||
integration-test: | ||
name: Test Harness for BigQuery | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Build Cache | ||
uses: actions/[email protected] | ||
with: | ||
key: build-${{ github.run_number }}-${{ github.run_attempt }} | ||
path: | | ||
**/target/** | ||
~/.m2/repository/org/liquibase/ | ||
- name: Run Test Harness Tests | ||
run: mvn -B jacoco:prepare-agent surefire:test -Dit.test=LiquibaseHarnessSuiteIT | ||
|
||
- name: Archive Test Results | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-reports-bigquery-integration | ||
path: | | ||
**/target/surefire-reports | ||
**/target/jacoco.exec | ||
dependabot: | ||
name: Merge dependabot | ||
runs-on: ubuntu-latest | ||
needs: integration-test | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
|
||
steps: | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/[email protected] | ||
|
||
- name: Approve patch and minor updates | ||
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}} | ||
run: | | ||
gh pr merge --auto --merge "$PR_URL" | ||
gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a patch or minor update**" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
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