diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..025b8c088 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,34 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + - name: coverage + uses: codecov/codecov-action@v1 + with: + name: actions ${{ matrix.java }} + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/linkage-monitor.sh \ No newline at end of file diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 29a21d612..8bcf7e298 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -15,7 +15,9 @@ set -eo pipefail -cd github/gax-java/ +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. # Print out Java java -version @@ -24,4 +26,7 @@ echo $JOB_TYPE ./gradlew assemble ./gradlew build install -bash $KOKORO_GFILE_DIR/codecov.sh +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh index 2f78d139f..e0ed52cc2 100755 --- a/.kokoro/linkage-monitor.sh +++ b/.kokoro/linkage-monitor.sh @@ -17,7 +17,9 @@ set -eo pipefail # Display commands being run. set -x -cd github/gax-java/ +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. # Print out Java version java -version