From fd973acd34175d3bc9349db6f3101b927e33f390 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 30 Oct 2020 15:14:39 -0400 Subject: build-test: Remove references to "travis" in build tests Use "ci-build.sh" "ci-install.sh" and similar, as travis-ci is no longer being used. Signed-off-by: Kevin O'Connor --- .github/workflows/build-test.yaml | 10 +++--- scripts/ci-build.sh | 67 +++++++++++++++++++++++++++++++++++++++ scripts/ci-install.sh | 46 +++++++++++++++++++++++++++ scripts/travis-build.sh | 67 --------------------------------------- scripts/travis-install.sh | 46 --------------------------- 5 files changed, 118 insertions(+), 118 deletions(-) create mode 100755 scripts/ci-build.sh create mode 100755 scripts/ci-install.sh delete mode 100755 scripts/travis-build.sh delete mode 100755 scripts/travis-install.sh diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index be4d74c4..bcd98fd3 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -14,17 +14,17 @@ jobs: - name: Setup cache uses: actions/cache@v2 with: - path: travis_cache - key: ${{ runner.os }}-build-${{ hashFiles('scripts/travis-install.sh') }} + path: ci_cache + key: ${{ runner.os }}-build-${{ hashFiles('scripts/ci-install.sh') }} - name: Prepare tests - run: ./scripts/travis-install.sh + run: ./scripts/ci-install.sh - name: Test - run: ./scripts/travis-build.sh 2>&1 + run: ./scripts/ci-build.sh 2>&1 - name: Upload micro-controller data dictionaries uses: actions/upload-artifact@v2 with: name: data-dict - path: travis_build/dict + path: ci_build/dict diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh new file mode 100755 index 00000000..e5f97754 --- /dev/null +++ b/scripts/ci-build.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Test script for continuous integration. + +# Stop script early on any error; check variables +set -eu + +# Paths to tools installed by ci-install.sh +MAIN_DIR=${PWD} +BUILD_DIR=${PWD}/ci_build +export PATH=${BUILD_DIR}/pru-gcc/bin:${PATH} +PYTHON=${BUILD_DIR}/python-env/bin/python + + +###################################################################### +# Section grouping output message helpers +###################################################################### + +start_test() +{ + echo "::group::=============== $1 $2" + set -x +} + +finish_test() +{ + set +x + echo "=============== Finished $2" + echo "::endgroup::" +} + + +###################################################################### +# Check for whitespace errors +###################################################################### + +start_test check_whitespace "Check whitespace" +./scripts/check_whitespace.sh +finish_test check_whitespace "Check whitespace" + + +###################################################################### +# Run compile tests for several different MCU types +###################################################################### + +DICTDIR=${BUILD_DIR}/dict +mkdir -p ${DICTDIR} + +for TARGET in test/configs/*.config ; do + start_test mcu_compile "$TARGET" + make clean + make distclean + unset CC + cp ${TARGET} .config + make olddefconfig + make V=1 + finish_test mcu_compile "$TARGET" + cp out/klipper.dict ${DICTDIR}/$(basename ${TARGET} .config).dict +done + + +###################################################################### +# Verify klippy host software +###################################################################### + +start_test klippy "Test invoke klippy" +$PYTHON scripts/test_klippy.py -d ${DICTDIR} test/klippy/*.test +finish_test klippy "Test invoke klippy" diff --git a/scripts/ci-install.sh b/scripts/ci-install.sh new file mode 100755 index 00000000..7a536c81 --- /dev/null +++ b/scripts/ci-install.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Build setup script for continuous integration testing. +# See ci-build.sh for the actual test steps. + +# Stop script early on any error; check variables; be verbose +set -eux + +MAIN_DIR=${PWD} +BUILD_DIR=${PWD}/ci_build +CACHE_DIR=${PWD}/ci_cache +mkdir -p ${BUILD_DIR} ${CACHE_DIR} + + +###################################################################### +# Install (or build) pru gcc +###################################################################### + +echo -e "\n\n=============== Install embedded pru gcc\n\n" +PRU_FILE=${CACHE_DIR}/gnupru.tar.gz +PRU_DIR=${BUILD_DIR}/pru-gcc + +if [ ! -f ${PRU_FILE} ]; then + cd ${BUILD_DIR} + git config --global user.email "you@example.com" + git config --global user.name "Your Name" + git clone https://github.com/dinuxbg/gnupru -b 2018.03-beta-rc3 --depth 1 + cd gnupru + export PREFIX=${PRU_DIR} + ./download-and-patch.sh 2>&1 | pv -nli 30 > ${BUILD_DIR}/gnupru-build.log + ./build.sh 2>&1 | pv -nli 30 >> ${BUILD_DIR}/gnupru-build.log + cd ${BUILD_DIR} + tar cfz ${PRU_FILE} pru-gcc/ +else + cd ${BUILD_DIR} + tar xfz ${PRU_FILE} +fi + + +###################################################################### +# Create python virtualenv environment +###################################################################### + +echo -e "\n\n=============== Install python virtualenv\n\n" +cd ${MAIN_DIR} +virtualenv -p python2 ${BUILD_DIR}/python-env +${BUILD_DIR}/python-env/bin/pip install -r ${MAIN_DIR}/scripts/klippy-requirements.txt diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh deleted file mode 100755 index 913a2aa0..00000000 --- a/scripts/travis-build.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# Test script for travis-ci.org continuous integration. - -# Stop script early on any error; check variables -set -eu - -# Paths to tools installed by travis-install.sh -MAIN_DIR=${PWD} -BUILD_DIR=${PWD}/travis_build -export PATH=${BUILD_DIR}/pru-gcc/bin:${PATH} -PYTHON=${BUILD_DIR}/python-env/bin/python - - -###################################################################### -# Travis CI helpers -###################################################################### - -start_test() -{ - echo "::group::=============== $1 $2" - set -x -} - -finish_test() -{ - set +x - echo "=============== Finished $2" - echo "::endgroup::" -} - - -###################################################################### -# Check for whitespace errors -###################################################################### - -start_test check_whitespace "Check whitespace" -./scripts/check_whitespace.sh -finish_test check_whitespace "Check whitespace" - - -###################################################################### -# Run compile tests for several different MCU types -###################################################################### - -DICTDIR=${BUILD_DIR}/dict -mkdir -p ${DICTDIR} - -for TARGET in test/configs/*.config ; do - start_test mcu_compile "$TARGET" - make clean - make distclean - unset CC - cp ${TARGET} .config - make olddefconfig - make V=1 - finish_test mcu_compile "$TARGET" - cp out/klipper.dict ${DICTDIR}/$(basename ${TARGET} .config).dict -done - - -###################################################################### -# Verify klippy host software -###################################################################### - -start_test klippy "Test invoke klippy" -$PYTHON scripts/test_klippy.py -d ${DICTDIR} test/klippy/*.test -finish_test klippy "Test invoke klippy" diff --git a/scripts/travis-install.sh b/scripts/travis-install.sh deleted file mode 100755 index 0bb1ff6d..00000000 --- a/scripts/travis-install.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Build setup script for travis-ci.org continuous integration testing. -# See travis-build.sh for the actual test steps. - -# Stop script early on any error; check variables; be verbose -set -eux - -MAIN_DIR=${PWD} -BUILD_DIR=${PWD}/travis_build -CACHE_DIR=${PWD}/travis_cache -mkdir -p ${BUILD_DIR} ${CACHE_DIR} - - -###################################################################### -# Install (or build) pru gcc -###################################################################### - -echo -e "\n\n=============== Install embedded pru gcc\n\n" -PRU_FILE=${CACHE_DIR}/gnupru.tar.gz -PRU_DIR=${BUILD_DIR}/pru-gcc - -if [ ! -f ${PRU_FILE} ]; then - cd ${BUILD_DIR} - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - git clone https://github.com/dinuxbg/gnupru -b 2018.03-beta-rc3 --depth 1 - cd gnupru - export PREFIX=${PRU_DIR} - ./download-and-patch.sh 2>&1 | pv -nli 30 > ${BUILD_DIR}/gnupru-build.log - ./build.sh 2>&1 | pv -nli 30 >> ${BUILD_DIR}/gnupru-build.log - cd ${BUILD_DIR} - tar cfz ${PRU_FILE} pru-gcc/ -else - cd ${BUILD_DIR} - tar xfz ${PRU_FILE} -fi - - -###################################################################### -# Create python virtualenv environment -###################################################################### - -echo -e "\n\n=============== Install python virtualenv\n\n" -cd ${MAIN_DIR} -virtualenv -p python2 ${BUILD_DIR}/python-env -${BUILD_DIR}/python-env/bin/pip install -r ${MAIN_DIR}/scripts/klippy-requirements.txt -- cgit v1.2.3-70-g09d2