-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feel free to revert, but see https://talk.openmrs.org/t/ci-within-openmrs-bamboo-vs-travis-vs-github-actions-vs-azure-pipelines/31252/6
- Loading branch information
Showing
3 changed files
with
57 additions
and
6 deletions.
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,56 @@ | ||
# this build is designed to replicate the Travis CI workflow | ||
name: Build with Maven | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
platform: [ ubuntu-latest ] | ||
java-version: [ 8 ] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
env: | ||
PLATFORM: ${{ matrix.platform }} | ||
JAVA_VERSION: ${{ matrix.java-version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
- name: Cache local Maven repository | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Install dependencies | ||
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true --batch-mode --show-version --file pom.xml | ||
- name: Build with Maven | ||
run: mvn test --batch-mode --file pom.xml | ||
# this is necessary to populate the environment variables for Coveralls properly | ||
- name: Set branch name and PR number | ||
id: refs | ||
env: | ||
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} | ||
run: | | ||
echo "::set-output name=branch_name::${BRANCH_NAME_OR_REF#refs/heads/}" | ||
echo "::set-output name=pr_number::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" | ||
- name: Update coverage | ||
env: | ||
CI_NAME: Github | ||
CI_BUILD_NUMBER: ${{ github.run_id }} | ||
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks | ||
CI_BRANCH: ${{ steps.refs.outputs.branch_name }} | ||
CI_PULL_REQUEST: ${{ steps.refs.outputs.pr_number }} | ||
run: mvn jacoco:report coveralls:report | ||
|
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 |
---|---|---|
|
@@ -62,7 +62,7 @@ nb-configuration.xml | |
.* | ||
!.gitignore | ||
!.gitattributes | ||
!.travis.yml | ||
!.github | ||
*~ | ||
############# | ||
|
||
|
This file was deleted.
Oops, something went wrong.