Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Commit 6b314cd

Browse files
authored
Add unit tests and crossdock in github actions (#775)
1 parent 2be525b commit 6b314cd

File tree

13 files changed

+131
-29
lines changed

13 files changed

+131
-29
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Setup BRANCH'
2+
description: 'Make BRANCH var accessible to job'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Setup BRANCH
7+
shell: bash
8+
run: |
9+
case ${GITHUB_EVENT_NAME} in
10+
pull_request)
11+
BRANCH=${GITHUB_HEAD_REF}
12+
;;
13+
push | release)
14+
BRANCH=${GITHUB_REF##*/}
15+
;;
16+
esac
17+
echo "we are on branch=${BRANCH}"
18+
echo "BRANCH=${BRANCH}" >> ${GITHUB_ENV}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Crossdock
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
crossdock:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
submodules: true
16+
17+
- uses: actions/setup-java@v1
18+
with:
19+
java-version: 8
20+
21+
- uses: docker/login-action@v1
22+
id: dockerhub-login
23+
with:
24+
username: jaegertracingbot
25+
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
env:
27+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
28+
if: env.DOCKERHUB_TOKEN != null
29+
30+
- name: Export DOCKERHUB_LOGIN variable
31+
run: |
32+
echo "DOCKERHUB_LOGIN=true" >> $GITHUB_ENV
33+
if: steps.dockerhub-login.outcome == 'success'
34+
35+
- name: Export BRANCH variable
36+
uses: ./.github/actions/setup-branch
37+
38+
- name: Run Crossdock
39+
id: run-crossdock
40+
run: make crossdock-fresh
41+
42+
- name: Output Crossdock Logs
43+
run: make crossdock-logs
44+
if: ${{ failure() }}
45+
46+
- name: Publish Crossdock Image
47+
run: bash scripts/publish-crossdock.sh
48+
if: steps.run-crossdock.outcome == 'success'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
unit-tests:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
submodules: true
16+
17+
- uses: actions/setup-java@v1
18+
with:
19+
java-version: 8
20+
21+
- name: Run unit tests
22+
run: make test-ci
23+
24+
- name: Generate codecov report
25+
run: ./gradlew codeCoverageReport
26+
27+
- name: Upload coverage to codecov
28+
uses: codecov/codecov-action@v1
29+
with:
30+
verbose: true
31+
fail_ci_if_error: true

β€ŽMakefileβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ clean:
1010
test:
1111
$(GRADLE) check
1212

13-
.PHONY: test-travis
14-
test-travis:
13+
.PHONY: test-ci
14+
test-ci:
1515
$(GRADLE) -is check
1616

1717
.PHONY: release

β€Žjaeger-crossdock/Dockerfileβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:8u121-jdk-alpine
1+
FROM openjdk:8-jdk-alpine
22
EXPOSE 8080-8082
33

44
ADD build/libs/jaeger-crossdock.jar /

β€Žjaeger-thrift/build.gradleβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies {
2222
}
2323

2424
compileThrift {
25-
thriftExecutable "${projectDir}/../travis/docker-thrift/thrift"
25+
thriftExecutable "${projectDir}/../scripts/docker-thrift/thrift"
2626
sourceDir "${projectDir}/../idl/thrift"
2727
outputDir 'src/main/gen-java'
2828
generator 'java', 'private-members'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ if [ "x${ENCRYPTION_IV}" == "x" ]; then
1515
fi
1616

1717
if [ "${TRAVIS_SECURE_ENV_VARS}" == true ]; then
18-
openssl aes-256-cbc -K "${ENCRYPTION_KEY}" -iv "${ENCRYPTION_IV}" -in travis/signing-key.asc.enc -out travis/signing-key.asc -d
18+
openssl aes-256-cbc -K "${ENCRYPTION_KEY}" -iv "${ENCRYPTION_IV}" -in scripts/signing-key.asc.enc -out scripts/signing-key.asc -d
1919
if (( $? != 0 )); then
2020
echo "Failed to decrypt the signing key. Skipping."
2121
exit 1
2222
fi
2323

24-
gpg --no-tty --batch --allow-secret-key-import --import travis/signing-key.asc
24+
gpg --no-tty --batch --allow-secret-key-import --import scripts/signing-key.asc
2525
rm -rf "$HOME/.gradle/gradle.properties"
2626
echo signing.keyId="${SIGNING_KEY_ID}" > "$HOME/.gradle/gradle.properties"
2727
echo signing.password="${SIGNING_KEY_PASSPHRASE}" >> "$HOME/.gradle/gradle.properties"

0 commit comments

Comments
Β (0)