Skip to content

Commit

Permalink
Merge pull request #1407 from treasure-data/github-actions
Browse files Browse the repository at this point in the history
Use GitHub Actions instead of Travis CI and improve the CI test itself
  • Loading branch information
komamitsu authored Jul 22, 2020
2 parents ca85577 + 89f3905 commit d1de1e0
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 87 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: CI

on:
push:
branches:
- master
- v0_10
pull_request:
branches:
- master
- v0_10

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run tests in Docker
run: ci/run_test.sh
env:
CI_NODE_INDEX: ${{ matrix.ci_node_index }}
CI_NODE_TOTAL: 10
BUILD_IMAGE: digdag/digdag-build:20191203T225216-c5b7206657c98c728b183634079f0a919ee98f8c

63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[![Circle CI](https://circleci.com/gh/treasure-data/digdag.svg?style=svg&circle-token=8ccc5c665022ce4d1ee05cf7b829c84877387a6c)](https://circleci.com/gh/treasure-data/digdag)

[![Travis CI](https://travis-ci.org/treasure-data/digdag.svg?branch=master)](https://travis-ci.org/treasure-data/digdag)
[![CI](https://github.com/treasure-data/digdag/workflows/CI/badge.svg)](https://github.com/treasure-data/digdag/actions)


## [Documentation](https://docs.digdag.io)

Expand Down Expand Up @@ -52,7 +53,7 @@ $ CI_ACCEPTANCE_TEST=true ./gradlew digdag-tests:test --info --tests acceptance.
```

To execute tests in digdag-tests subproject locally, `tests` option that is provided by Gradle is useful.
Environment variable `CI_ACCEPTANCE_TEST=true` is needed to execute digdag-tests only.
Environment variable `CI_ACCEPTANCE_TEST=true` is needed to execute digdag-tests.

### Testing with PostgreSQL

Expand Down
15 changes: 13 additions & 2 deletions ci/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ if [[ $(( 1 % ${CI_NODE_TOTAL} )) -eq ${CI_NODE_INDEX} ]]; then
"${BASEDIR}/validate.sh"
fi

"${BASEDIR}/run_test_h2.sh"
"${BASEDIR}/run_test_pg.sh"
WITH_BUILD_UI=""
WITHOUT_BUILD_UI="-x buildUi"

# Don't need to build UI always
if [[ $(( 2 % ${CI_NODE_TOTAL} )) -eq ${CI_NODE_INDEX} ]]; then
BUILD_UI_OPT=${WITH_BUILD_UI}
else
BUILD_UI_OPT=${WITHOUT_BUILD_UI}
fi

# It's enough to build UI either with H2 or PostgreSQL not with the both
"${BASEDIR}/run_test_h2.sh" ${WITHOUT_BUILD_UI}
"${BASEDIR}/run_test_pg.sh" ${BUILD_UI_OPT}

2 changes: 1 addition & 1 deletion ci/run_test_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ docker run \
-e TEST_S3_SECRET_ACCESS_KEY=$TEST_S3_SECRET_ACCESS_KEY \
-e TERM=dumb \
$BUILD_IMAGE \
./gradlew clean cleanTest test --info --no-daemon "$@"
./gradlew clean cleanTest test --info --stacktrace --no-daemon "$@"
2 changes: 1 addition & 1 deletion ci/run_test_h2.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -xe
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

$BASEDIR/run_test_docker.sh
$BASEDIR/run_test_docker.sh "$@"
2 changes: 1 addition & 1 deletion ci/run_test_pg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ minimumPoolSize = 0

export DIGDAG_TEST_REDIS=127.0.0.1

$BASEDIR/run_test_docker.sh
$BASEDIR/run_test_docker.sh "$@"
17 changes: 0 additions & 17 deletions ci/travis_report_coverage.sh

This file was deleted.

0 comments on commit d1de1e0

Please sign in to comment.