Skip to content

Commit 17d7b9d

Browse files
raunaqmorarkaRaunaq Morarka
andauthored
Replace travis ci with github workflow (#357)
Co-authored-by: Raunaq Morarka <[email protected]>
1 parent 5780d2a commit 17d7b9d

File tree

4 files changed

+38
-29
lines changed

4 files changed

+38
-29
lines changed

.github/workflows/ci-tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ci-tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
integration-tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-java@v1
17+
with:
18+
java-version: 7
19+
- uses: codecov/codecov-action@v1
20+
- uses: actions/cache@v1
21+
with:
22+
path: ~/.m2/repository
23+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
24+
restore-keys: |
25+
${{ runner.os }}-maven-
26+
- name: Setup Build
27+
env:
28+
RUBIX_DOCKER_NETWORK_NAME: "network-rubix-build"
29+
run: /bin/bash rubix_setup_build.sh
30+
- name: Run Integration Tests
31+
env:
32+
RUBIX_DOCKER_NETWORK_NAME: "network-rubix-build"
33+
run: chmod a+x docker_build_rubix.sh && /bin/bash rubix_run_build.sh mvn integration-test -Pintegration-tests

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

docker_build_rubix.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash -e
22

33
build-rubix-jars-for-tests() {
4-
mvn clean install -DskipTests
4+
mvn clean -B install -DskipTests
55

66
HADOOP_LIB_DIR="/usr/lib/hadoop2/share/hadoop/tools/lib/"
77
RUBIX_JARS=$(ls ${PWD}/rubix-*/target/rubix-*.jar | grep -v tests)
@@ -10,13 +10,11 @@ build-rubix-jars-for-tests() {
1010
sudo cp ${RUBIX_JARS} ${HADOOP_LIB_DIR}
1111
}
1212

13-
upload-coverage-results() {
13+
run-tests-with-coverage() {
1414
echo "=== Running tests with coverage ==="
1515
# "cobertura-integration-test" goal needed for shading JARs
1616
# if run on CI, integration tests will have been run before this
1717
mvn cobertura:cobertura-integration-test
18-
echo "=== Uploading code coverage results to Codecov ==="
19-
bash <(curl -s https://codecov.io/bash)
2018
}
2119

2220
build-rubix-jars-for-tests
@@ -29,6 +27,6 @@ if [[ $? -ne 0 ]]; then
2927
exit 1
3028
fi
3129

32-
if [[ -n "${TRAVIS}" ]]; then
33-
upload-coverage-results
30+
if [[ -n "${GITHUB_ACTIONS}" ]]; then
31+
run-tests-with-coverage
3432
fi

rubix_run_build.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
MAVEN_CMD="$@"
44

55
echo "=== Starting Docker container for build (cmd: ${MAVEN_CMD})==="
6-
docker run -it --rm \
6+
docker run -i --rm \
77
--network=network-rubix-build \
88
--volume /var/run/docker.sock:/var/run/docker.sock \
99
--volume "$PWD":/usr/src/rubix \
1010
--volume "$HOME/.m2":/root/.m2 \
1111
--volume "/tmp/rubix:/tmp/rubix" \
1212
--workdir /usr/src/rubix \
13-
${TRAVIS_ENV} \
1413
quboleinc/hadoop_mvn_thrift /bin/bash -c "./docker_build_rubix.sh ${MAVEN_CMD}"

0 commit comments

Comments
 (0)