Skip to content

Commit dc8c49a

Browse files
authored
Merge pull request #1173 from watson-developer-cloud/9258-gha
ci: 9258 gha
2 parents de925e8 + a3f900d commit dc8c49a

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/build-test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support documentation.
4+
# This workflow will do a clean install of java dependencies, build the source code and run tests across different versions of java
5+
# For more information see: https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven
6+
7+
name: Build and Test
8+
9+
on:
10+
push:
11+
branches: [ '**' ]
12+
pull_request:
13+
branches: [ master ]
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
jobs:
19+
build_test:
20+
name: Build and Test on Java ${{ matrix.java-version }} and ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
matrix:
24+
java-version: ['8']
25+
os: [ubuntu-latest]
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Set up Java
31+
uses: actions/setup-java@v2
32+
with:
33+
java-version: ${{ matrix.java-version }}
34+
distribution: 'adopt'
35+
36+
- name: Install Java dependencies
37+
run: curl -s https://codecov.io/bash > $HOME/codecov-bash.sh && chmod +x $HOME/codecov-bash.sh
38+
39+
- name: Execute Java unit tests
40+
env:
41+
MVN_ARGS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
42+
run: mvn verify -fae -DskipITs $MVN_ARGS
43+
44+
- name: Publish Java code coverage
45+
if: github.ref == 'refs/heads/master'
46+
env:
47+
CC_TOK: ${{ secrets.CODECOV_TOKEN }}
48+
run: $HOME/codecov-bash.sh -s modules/coverage-reports/target/site/jacoco-aggregate -t $CC_TOK

0 commit comments

Comments
 (0)