This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github action for crossdock tests (#297)
* Add github action for crossdock Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com> * Increase code coverage Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
- Loading branch information
1 parent
923c455
commit 6bf76a1
Showing
4 changed files
with
86 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: CIT Crossdock | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
crossdock: | ||
runs-on: ubuntu-latest | ||
env: | ||
TORNADO: ">=4,<5" | ||
VIRTUAL_ENV: "github" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 2.7 | ||
|
||
- uses: docker/login-action@v1 | ||
id: dockerhub-login | ||
with: | ||
username: jaegertracingbot | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
env: | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
if: env.DOCKERHUB_TOKEN != null | ||
|
||
- name: Export DOCKERHUB_LOGIN variable | ||
run: | | ||
echo "DOCKERHUB_LOGIN=true" >> $GITHUB_ENV | ||
if: steps.dockerhub-login.outcome == 'success' | ||
|
||
- name: Export BRANCH variable for pull_request event | ||
run: | | ||
export BRANCH=${GITHUB_HEAD_REF} | ||
echo "we are on branch=$BRANCH" | ||
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV | ||
if: github.event_name == 'pull_request' | ||
|
||
- name: Export BRANCH variable for push event | ||
run: | | ||
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
if: github.event_name == 'push' | ||
|
||
- name: Install pycurl dependencies | ||
run: sudo apt-get install libgnutls28-dev libcurl4-openssl-dev libssl-dev | ||
|
||
- name: Install dependencies | ||
run: make bootstrap | ||
|
||
- name: Build crossdock | ||
run: bash scripts/build-crossdock.sh | ||
|
||
- name: Output crossdock logs | ||
run: make crossdock-logs | ||
if: ${{ failure() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -euxf -o pipefail | ||
|
||
make crossdock | ||
|
||
export REPO=jaegertracing/xdock-py | ||
export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) | ||
export TAG=`if [ "$BRANCH" == "master" ]; then echo "latest"; else echo "${BRANCH///}"; fi` | ||
export TORNADO=$TORNADO | ||
echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, REPO=$REPO, PR=$PR, BRANCH=$BRANCH, TAG=$TAG, TORNADO=$TORNADO" | ||
REPO=jaegertracing/xdock-py | ||
BRANCH=${BRANCH:?'missing BRANCH env var'} | ||
TORNADO=${TORNADO:?'missing TORNADO env var'} | ||
TAG=$([ "$BRANCH" == "master" ] && echo "latest" || echo "$BRANCH") | ||
COMMIT=${GITHUB_SHA::8} | ||
DOCKERHUB_LOGIN=${DOCKERHUB_LOGIN:-false} | ||
|
||
# Only push the docker container to Docker Hub for master branch | ||
if [[ "$BRANCH" == "master" && "$TRAVIS_SECURE_ENV_VARS" == "true" ]]; then | ||
echo "REPO=$REPO, BRANCH=$BRANCH, TAG=$TAG, TORNADO=$TORNADO, COMMIT=$COMMIT" | ||
|
||
# Only push the docker container to dockerhub for master branch and when dockerhub login is done | ||
if [[ "$BRANCH" == "master" && "$DOCKERHUB_LOGIN" == "true" ]]; then | ||
echo 'upload to Docker Hub' | ||
else | ||
echo 'skip docker upload for PR' | ||
exit 0 | ||
fi | ||
|
||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
|
||
set -x | ||
|
||
docker build --build-arg tornado=$TORNADO -f crossdock/Dockerfile -t $REPO:$COMMIT . | ||
docker build -f crossdock/Dockerfile \ | ||
--build-arg tornado=$TORNADO \ | ||
--tag $REPO:$COMMIT . | ||
|
||
docker tag $REPO:$COMMIT $REPO:$TAG | ||
docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER | ||
docker tag $REPO:$COMMIT $REPO:gh-$GITHUB_RUN_NUMBER | ||
docker push $REPO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters