From 87992f3669c77a808d4d34681192adec22e2556f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Dec 2019 19:11:53 -0600 Subject: [PATCH] Use Github Actions for CI, date bump (#16269) --- .github/workflows/bump-date.yml | 25 ++++++++ .github/workflows/test-builds.yml | 95 ++++++++++++++++++++++++++++++ .travis.yml | 84 -------------------------- Marlin/src/inc/Conditionals_post.h | 3 + buildroot/bin/bump_date | 17 ++++++ 5 files changed, 140 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/bump-date.yml create mode 100644 .github/workflows/test-builds.yml delete mode 100644 .travis.yml create mode 100755 buildroot/bin/bump_date diff --git a/.github/workflows/bump-date.yml b/.github/workflows/bump-date.yml new file mode 100644 index 000000000..df2ac5fbd --- /dev/null +++ b/.github/workflows/bump-date.yml @@ -0,0 +1,25 @@ +# +# bump-date.yml +# Bump the distribution date once per day +# + +name: Bump Distribution Date + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + bump_date: + + runs-on: ubuntu-latest + + steps: + + - name: Check out bugfix-2.0.x + uses: actions/checkout@v2 + with: + ref: bugfix-2.0.x + + - name: Bump Distribution Date + run: source ./buildroot/bin/bump_date diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml new file mode 100644 index 000000000..b6aebcb67 --- /dev/null +++ b/.github/workflows/test-builds.yml @@ -0,0 +1,95 @@ +# +# test-builds.yml +# Do test builds to catch compile errors +# + +name: CI + +on: + pull_request: + branches: + - bugfix-2.0.x + - dev-2.1.x + +jobs: + test_builds: + + runs-on: ubuntu-latest + + strategy: + matrix: + test-platform: + # Base Environments + + - DUE + - esp32 + - linux_native + - megaatmega2560 + - teensy31 + - teensy35 + + # Extended AVR Environments + + - FYSETC_F6_13 + - megaatmega1280 + - rambo + - sanguino_atmega1284p + - sanguino_atmega644p + + # Extended STM32 Environments + + - STM32F103RC_bigtree + - STM32F103RC_bigtree_USB + - STM32F103RE_bigtree + - STM32F103RE_bigtree_USB + - STM32F103RC_fysetc + - jgaurora_a5s_a1 + - STM32F103VE_longer + - STM32F407VE_black + - BIGTREE_SKR_PRO + - mks_robin + - ARMED + + # Put lengthy tests last + + - LPC1768 + - LPC1769 + + # STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working. + + #- STM32F4 + #- STM32F7 + + # Non-working environment tests + + #- BIGTREE_BTT002 + #- at90usb1286_cdc + #- at90usb1286_dfu + #- STM32F103CB_malyan + #- mks_robin_lite + #- mks_robin_mini + #- mks_robin_nano + #- SAMD51_grandcentral_m4 + + steps: + + - name: Select Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax. + architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + + - name: Install PlatformIO + run: | + pip install -U https://github.com/platformio/platformio-core/archive/master.zip + platformio update + + - name: Check out the PR + uses: actions/checkout@v2 + + - name: Run ${{ matrix.test-platform }} Tests + run: | + chmod +x buildroot/bin/* + chmod +x buildroot/share/tests/* + export PATH=./buildroot/bin/:./buildroot/share/tests/:${PATH} + run_tests . ${{ matrix.test-platform }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f9841e891..000000000 --- a/.travis.yml +++ /dev/null @@ -1,84 +0,0 @@ -dist: bionic -sudo: false - -language: python -python: - - "3.7" - -notifications: - email: false - -env: - # Base Environments - - TEST_PLATFORM="DUE" - - TEST_PLATFORM="esp32" - - TEST_PLATFORM="linux_native" - - TEST_PLATFORM="megaatmega2560" - - TEST_PLATFORM="teensy31" - - TEST_PLATFORM="teensy35" - - # Extended AVR Environments - - TEST_PLATFORM="FYSETC_F6_13" - - TEST_PLATFORM="megaatmega1280" - - TEST_PLATFORM="rambo" - - TEST_PLATFORM="sanguino_atmega1284p" - - TEST_PLATFORM="sanguino_atmega644p" - - # Extended STM32 Environments - - TEST_PLATFORM="STM32F103RC_bigtree" - - TEST_PLATFORM="STM32F103RC_bigtree_USB" - - TEST_PLATFORM="STM32F103RE_bigtree" - - TEST_PLATFORM="STM32F103RE_bigtree_USB" - - TEST_PLATFORM="STM32F103RC_fysetc" - - TEST_PLATFORM="jgaurora_a5s_a1" - - TEST_PLATFORM="STM32F103VE_longer" - - TEST_PLATFORM="STM32F407VE_black" - - TEST_PLATFORM="BIGTREE_SKR_PRO" - - TEST_PLATFORM="mks_robin" - - TEST_PLATFORM="ARMED" - - # STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working. - #- TEST_PLATFORM="STM32F4" - #- TEST_PLATFORM="STM32F7" - - # Put lengthy tests last - - TEST_PLATFORM="LPC1768" - - TEST_PLATFORM="LPC1769" - - # Non-working environment tests - #- TEST_PLATFORM="BIGTREE_BTT002" this board isn't released yet. we need pinout to be sure about what we do - #- TEST_PLATFORM="at90usb1286_cdc" - #- TEST_PLATFORM="at90usb1286_dfu" - #- TEST_PLATFORM="STM32F103CB_malyan" - #- TEST_PLATFORM="mks_robin_lite" - #- TEST_PLATFORM="mks_robin_mini" - #- TEST_PLATFORM="mks_robin_nano" - #- TEST_PLATFORM="SAMD51_grandcentral_m4" - -before_install: - # - # Fetch the tag information for the current branch - - git fetch origin --tags - # - # Publish the buildroot script folder - - chmod +x ${TRAVIS_BUILD_DIR}/buildroot/bin/* - - chmod +x ${TRAVIS_BUILD_DIR}/buildroot/share/tests/* - - export PATH=${TRAVIS_BUILD_DIR}/buildroot/bin/:${TRAVIS_BUILD_DIR}/buildroot/share/tests/:${PATH} - -install: - #- pip install -U platformio - - pip install -U https://github.com/platformio/platformio-core/archive/master.zip - -before_script: - # Update PlatformIO packages - - platformio update - # - # Change current working directory to the build dir - - cd ${TRAVIS_BUILD_DIR} - # - # Generate custom version include - - generate_version ${TRAVIS_BUILD_DIR}/Marlin/ - - cat ${TRAVIS_BUILD_DIR}/Marlin/Version.h - # -script: - - run_tests ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index b06523cae..eb9692ab6 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -26,6 +26,9 @@ * Defines that depend on configuration but are not editable. */ +#ifdef GITHUB_ACTIONS + // Extras for CI testing +#endif #ifdef TEENSYDUINO #undef max diff --git a/buildroot/bin/bump_date b/buildroot/bin/bump_date new file mode 100755 index 000000000..77df90bbd --- /dev/null +++ b/buildroot/bin/bump_date @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# bump_date +# +# Bump the Distribution Date in Version.h +# + +VERSION_FILE=Marlin/src/inc/Version.h + +SED=$(which gsed || which sed) + +DIST=$( date +"%Y-%m-%d" ) + +eval "${SED} -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' $VERSION_FILE" || exit 1 + +git add "$VERSION_FILE" || exit 1 +git commit -m "[cron] Bump distribution date ($DIST)"