Skip to content

Commit

Permalink
Issue 156: move to circle CI (#157)
Browse files Browse the repository at this point in the history
* move from travis to circle

The Yaml and concept between circle and travis is completely different. Updated environment variables ans the like. Created a new GHE token with the correct access and it works.
  • Loading branch information
al-niessner authored Nov 13, 2021
1 parent f90ba1f commit f4dcd93
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .ci/check_01.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ post_state "$context" "$description" "$state"

if current_state
then
docker run --rm -v $PWD:$PWD -u $UID -w $PWD cit:$(cit_version) pycodestyle \
docker run --rm -v $PWD:$PWD -u $UID -w $PWD niessner/cit:$(cit_version) pycodestyle \
--ignore=E24,E121,E123,E124,E126,E127,E211,E225,E226,E231,E252,E301,E302,E305,E402,E501,W504,E701,E702,E704,E722,E741 \
--exclude=binding.py \
--statistics Python Test | tee pep8.rpt.txt
Expand Down
2 changes: 1 addition & 1 deletion .ci/check_02.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ post_state "$context" "$description" "$state"

if current_state
then
docker run --rm -v $PWD:$PWD -u $UID -w $PWD cit:$(cit_version) pylint --rcfile=.ci/pylint.rc Python/dawgie Test/ae | tee pylint.rpt.txt
docker run --rm -v $PWD:$PWD -u $UID -w $PWD niessner/cit:$(cit_version) pylint --rcfile=.ci/pylint.rc Python/dawgie Test/ae | tee pylint.rpt.txt
python3 <<EOF
mn = '<unknown>'
count = 0
Expand Down
2 changes: 1 addition & 1 deletion .ci/check_03.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ post_state "$context" "$description" "$state"

if current_state
then
docker run --rm -e PYTHONPATH=${PWD}/Python -e USERNAME="$(whoami)" -v $PWD:$PWD -u $UID -w $PWD cit:$(cit_version) python3 -m pytest --cov=dawgie --cov-branch --cov-report term-missing -v Test | tee unittest.rpt.txt
docker run --rm -e PYTHONPATH=${PWD}/Python -e USERNAME="$(whoami)" -v $PWD:$PWD -u $UID -w $PWD niessner/cit:$(cit_version) python3 -m pytest --cov=dawgie --cov-branch --cov-report term-missing -v Test | tee unittest.rpt.txt
[ 0 -lt `grep FAILED unittest.rpt.txt | wc -l` ] && echo 'failure' > .ci/status.txt
state=`get_state`
fi
Expand Down
2 changes: 1 addition & 1 deletion .ci/check_04.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ post_state "$context" "$description" "$state"

if current_state
then
docker run --rm -e PYTHONPATH=${PWD}/Python -e USERNAME="$(whoami)" -v $PWD:$PWD -u $UID -w $PWD -i cit:$(cit_version) python3 <<EOF
docker run --rm -e PYTHONPATH=${PWD}/Python -e USERNAME="$(whoami)" -v $PWD:$PWD -u $UID -w $PWD -i niessner/cit:$(cit_version) python3 <<EOF
import datetime
import os
Expand Down
7 changes: 1 addition & 6 deletions .ci/step_00.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,13 @@ then
if [ -z "$(docker images | awk -e '{print $1":"$2}' | grep cit:$citVersion)" ]
then
echo " Building CI Tools layer $citVersion"
docker build --network=host -t cit:${citVersion} - < .ci/Dockerfile.3
docker build --network=host -t niessner/cit:${citVersion} - < .ci/Dockerfile.3
fi

rm .ci/Dockerfile.1 .ci/Dockerfile.2 .ci/Dockerfile.3
docker login -p ${DOCKER_LOGIN_PASSWORD} -u ${DOCKER_LOGIN_ID}
docker tag cit:${citVersion} niessner/cit:${citVersion}
docker push niessner/cit:${citVersion}
docker logout
docker rmi niessner/cit:${citVersion}
else
docker tag niessner/cit:${citVersion} cit:${citVersion}
docker rmi niessner/cit:${citVersion}
fi
fi
state=`get_state`
Expand Down
6 changes: 3 additions & 3 deletions .ci/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
GHE_API_URL=https://api.github.com
ghrVersion=${ghrVersion:-"`git describe --tags`"}
PYTHONPATH=${PWD}/Python:${PWD}/Test
REPO=niessner/DAWGIE
REPO=al-niessner/DAWGIE

export GHE_API_URL PATH PYTHONPATH

Expand Down Expand Up @@ -128,8 +128,8 @@ post_state ()

curl -XPOST \
-H "Authorization: token ${GHE_TOKEN}" \
${GHE_API_URL}/repos/${TRAVIS_REPO_SLUG}/statuses/${TRAVIS_PULL_REQUEST_SHA} \
-d "{\"state\": \"${3}\", \"target_url\": \"${TRAVIS_BUILD_WEB_URL}\", \"description\": \"${2}\", \"context\": \"${1}\"}" > /dev/null 2>&1
${GHE_API_URL}/repos/${REPO}/statuses/${CIRCLE_SHA1} \
-d "{\"state\": \"${3}\", \"target_url\": \"${CIRCLE_BUILD_URL}\", \"description\": \"${2}\", \"context\": \"${1}\"}" ##> /dev/null 2>&1
}

which_port ()
Expand Down
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2.1
jobs:
build:
machine: # executor type
image: ubuntu-2004:202010-01
steps:
- checkout
- run:
name: Prepare the machine to run the checks
command: .ci/step_00.sh
- run:
name: PEP-8 compliance
command: .ci/check_01.sh
- run:
name: PyLint compliance
command: .ci/check_02.sh
- run:
name: Unittest compliance
command: .ci/check_03.sh
- run:
name: Legal (licensing) compliance
command: .ci/check_04.sh
- run:
name: Conclude the checks
command: .ci/step_99.sh

0 comments on commit f4dcd93

Please sign in to comment.