Parcourir la source

Use Github Actions for CI, date bump (#16269)

Scott Lahteine il y a 4 ans
Parent
révision
87992f3669
Aucun compte lié à l'adresse e-mail de l'auteur

+ 25
- 0
.github/workflows/bump-date.yml Voir le fichier

@@ -0,0 +1,25 @@
1
+#
2
+# bump-date.yml
3
+# Bump the distribution date once per day
4
+#
5
+
6
+name: Bump Distribution Date
7
+
8
+on:
9
+  schedule:
10
+    - cron:  '0 0 * * *'
11
+
12
+jobs:
13
+  bump_date:
14
+
15
+    runs-on: ubuntu-latest
16
+
17
+    steps:
18
+
19
+    - name: Check out bugfix-2.0.x
20
+      uses: actions/checkout@v2
21
+      with:
22
+        ref: bugfix-2.0.x
23
+
24
+    - name: Bump Distribution Date
25
+      run: source ./buildroot/bin/bump_date

+ 95
- 0
.github/workflows/test-builds.yml Voir le fichier

@@ -0,0 +1,95 @@
1
+#
2
+# test-builds.yml
3
+# Do test builds to catch compile errors
4
+#
5
+
6
+name: CI
7
+
8
+on:
9
+  pull_request:
10
+    branches:
11
+    - bugfix-2.0.x
12
+    - dev-2.1.x
13
+
14
+jobs:
15
+  test_builds:
16
+
17
+    runs-on: ubuntu-latest
18
+
19
+    strategy:
20
+      matrix:
21
+        test-platform:
22
+        # Base Environments
23
+
24
+        - DUE
25
+        - esp32
26
+        - linux_native
27
+        - megaatmega2560
28
+        - teensy31
29
+        - teensy35
30
+
31
+        # Extended AVR Environments
32
+
33
+        - FYSETC_F6_13
34
+        - megaatmega1280
35
+        - rambo
36
+        - sanguino_atmega1284p
37
+        - sanguino_atmega644p
38
+
39
+        # Extended STM32 Environments
40
+
41
+        - STM32F103RC_bigtree
42
+        - STM32F103RC_bigtree_USB
43
+        - STM32F103RE_bigtree
44
+        - STM32F103RE_bigtree_USB
45
+        - STM32F103RC_fysetc
46
+        - jgaurora_a5s_a1
47
+        - STM32F103VE_longer
48
+        - STM32F407VE_black
49
+        - BIGTREE_SKR_PRO
50
+        - mks_robin
51
+        - ARMED
52
+
53
+        # Put lengthy tests last
54
+
55
+        - LPC1768
56
+        - LPC1769
57
+
58
+        # STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working.
59
+
60
+        #- STM32F4
61
+        #- STM32F7
62
+
63
+        # Non-working environment tests
64
+
65
+        #- BIGTREE_BTT002
66
+        #- at90usb1286_cdc
67
+        #- at90usb1286_dfu
68
+        #- STM32F103CB_malyan
69
+        #- mks_robin_lite
70
+        #- mks_robin_mini
71
+        #- mks_robin_nano
72
+        #- SAMD51_grandcentral_m4
73
+
74
+    steps:
75
+
76
+    - name: Select Python 3.7
77
+      uses: actions/setup-python@v1
78
+      with:
79
+        python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax.
80
+        architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
81
+
82
+    - name: Install PlatformIO
83
+      run: |
84
+        pip install -U https://github.com/platformio/platformio-core/archive/master.zip
85
+        platformio update
86
+
87
+    - name: Check out the PR
88
+      uses: actions/checkout@v2
89
+
90
+    - name: Run ${{ matrix.test-platform }} Tests
91
+      run: |
92
+        chmod +x buildroot/bin/*
93
+        chmod +x buildroot/share/tests/*
94
+        export PATH=./buildroot/bin/:./buildroot/share/tests/:${PATH}
95
+        run_tests . ${{ matrix.test-platform }}

+ 0
- 84
.travis.yml Voir le fichier

@@ -1,84 +0,0 @@
1
-dist: bionic
2
-sudo: false
3
-
4
-language: python
5
-python:
6
-  - "3.7"
7
-
8
-notifications:
9
-  email: false
10
-
11
-env:
12
-  # Base Environments
13
-  - TEST_PLATFORM="DUE"
14
-  - TEST_PLATFORM="esp32"
15
-  - TEST_PLATFORM="linux_native"
16
-  - TEST_PLATFORM="megaatmega2560"
17
-  - TEST_PLATFORM="teensy31"
18
-  - TEST_PLATFORM="teensy35"
19
-
20
-  # Extended AVR Environments
21
-  - TEST_PLATFORM="FYSETC_F6_13"
22
-  - TEST_PLATFORM="megaatmega1280"
23
-  - TEST_PLATFORM="rambo"
24
-  - TEST_PLATFORM="sanguino_atmega1284p"
25
-  - TEST_PLATFORM="sanguino_atmega644p"
26
-
27
-  # Extended STM32 Environments
28
-  - TEST_PLATFORM="STM32F103RC_bigtree"
29
-  - TEST_PLATFORM="STM32F103RC_bigtree_USB"
30
-  - TEST_PLATFORM="STM32F103RE_bigtree"
31
-  - TEST_PLATFORM="STM32F103RE_bigtree_USB"
32
-  - TEST_PLATFORM="STM32F103RC_fysetc"
33
-  - TEST_PLATFORM="jgaurora_a5s_a1"
34
-  - TEST_PLATFORM="STM32F103VE_longer"
35
-  - TEST_PLATFORM="STM32F407VE_black"
36
-  - TEST_PLATFORM="BIGTREE_SKR_PRO"
37
-  - TEST_PLATFORM="mks_robin"
38
-  - TEST_PLATFORM="ARMED"
39
-
40
-  # STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working.
41
-  #- TEST_PLATFORM="STM32F4"
42
-  #- TEST_PLATFORM="STM32F7"
43
-
44
-  # Put lengthy tests last
45
-  - TEST_PLATFORM="LPC1768"
46
-  - TEST_PLATFORM="LPC1769"
47
-
48
-  # Non-working environment tests
49
-  #- TEST_PLATFORM="BIGTREE_BTT002" this board isn't released yet. we need pinout to be sure about what we do
50
-  #- TEST_PLATFORM="at90usb1286_cdc"
51
-  #- TEST_PLATFORM="at90usb1286_dfu"
52
-  #- TEST_PLATFORM="STM32F103CB_malyan"
53
-  #- TEST_PLATFORM="mks_robin_lite"
54
-  #- TEST_PLATFORM="mks_robin_mini"
55
-  #- TEST_PLATFORM="mks_robin_nano"
56
-  #- TEST_PLATFORM="SAMD51_grandcentral_m4"
57
-
58
-before_install:
59
-  #
60
-  # Fetch the tag information for the current branch
61
-  - git fetch origin --tags
62
-  #
63
-  # Publish the buildroot script folder
64
-  - chmod +x ${TRAVIS_BUILD_DIR}/buildroot/bin/*
65
-  - chmod +x ${TRAVIS_BUILD_DIR}/buildroot/share/tests/*
66
-  - export PATH=${TRAVIS_BUILD_DIR}/buildroot/bin/:${TRAVIS_BUILD_DIR}/buildroot/share/tests/:${PATH}
67
-
68
-install:
69
-  #- pip install -U platformio
70
-  - pip install -U https://github.com/platformio/platformio-core/archive/master.zip
71
-
72
-before_script:
73
-  # Update PlatformIO packages
74
-  - platformio update
75
-  #
76
-  # Change current working directory to the build dir
77
-  - cd ${TRAVIS_BUILD_DIR}
78
-  #
79
-  # Generate custom version include
80
-  - generate_version ${TRAVIS_BUILD_DIR}/Marlin/
81
-  - cat ${TRAVIS_BUILD_DIR}/Marlin/Version.h
82
-  #
83
-script:
84
-  - run_tests ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}

+ 3
- 0
Marlin/src/inc/Conditionals_post.h Voir le fichier

@@ -26,6 +26,9 @@
26 26
  * Defines that depend on configuration but are not editable.
27 27
  */
28 28
 
29
+#ifdef GITHUB_ACTIONS
30
+  // Extras for CI testing
31
+#endif
29 32
 
30 33
 #ifdef TEENSYDUINO
31 34
   #undef max

+ 17
- 0
buildroot/bin/bump_date Voir le fichier

@@ -0,0 +1,17 @@
1
+#!/usr/bin/env bash
2
+#
3
+# bump_date
4
+#
5
+# Bump the Distribution Date in Version.h
6
+#
7
+
8
+VERSION_FILE=Marlin/src/inc/Version.h
9
+
10
+SED=$(which gsed || which sed)
11
+
12
+DIST=$( date +"%Y-%m-%d" )
13
+
14
+eval "${SED} -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' $VERSION_FILE" || exit 1
15
+
16
+git add "$VERSION_FILE" || exit 1
17
+git commit -m "[cron] Bump distribution date ($DIST)"

Chargement…
Annuler
Enregistrer