|
| 1 | +name: lint |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + build: |
| 5 | + name: Build for Lint Tasks |
| 6 | + runs-on: ubuntu-latest |
| 7 | + container: debian:stable |
| 8 | + steps: |
| 9 | + - name: Update package database |
| 10 | + run: apt-get update -y |
| 11 | + # See comments beginning at |
| 12 | + # https://github.com/actions/runner/issues/763#issuecomment-1435474884 |
| 13 | + # Without Git, actions/checkout@v3 will resort to REST and will not |
| 14 | + # create a .git folder or .git.config. The Problem Matcher looks for |
| 15 | + # .git/config to find where the root of the repo is, so it must be |
| 16 | + # present. |
| 17 | + - name: Install Git |
| 18 | + run: apt-get -y install git |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - name: Install build tools |
| 21 | + shell: bash |
| 22 | + run: | |
| 23 | + apt-get -y install pkg-config libtool autoconf \ |
| 24 | + automake g++ bison flex make bash-completion dh-autoreconf \ |
| 25 | + debhelper devscripts wget python3-pip |
| 26 | + - name: Install Python lint tools |
| 27 | + run: python3 -m pip install --no-input cpplint flake8 |
| 28 | + - name: Install build dependencies |
| 29 | + shell: bash |
| 30 | + run: | |
| 31 | + apt-get -y install libcppunit-dev uuid-dev libncurses5-dev \ |
| 32 | + libmicrohttpd-dev protobuf-compiler python3-protobuf \ |
| 33 | + libprotobuf-dev libprotoc-dev zlib1g-dev libftdi-dev \ |
| 34 | + libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy |
| 35 | + - name: Autoreconf |
| 36 | + run: autoreconf -i |
| 37 | + - name: Configure |
| 38 | + run: ./configure --enable-rdm-tests --enable-ja-rule --enable-e133 |
| 39 | + - name: Build builtfiles |
| 40 | + run: make builtfiles VERBOSE=1 |
| 41 | + - name: Display structure of the built files |
| 42 | + if: env.ACTIONS_STEP_DEBUG == 'true' |
| 43 | + run: ls -alR |
| 44 | + - name: Archive artifacts to speed up slow GH Actions upload/download |
| 45 | + shell: bash |
| 46 | + # If the file does not exist when tar excludes it, then it will not |
| 47 | + # actually exclude it, so it must first be touched |
| 48 | + run: | |
| 49 | + touch ola-debian-stable-built-source-tree.tar.gz |
| 50 | + tar --exclude=ola-debian-stable-built-source-tree.tar.gz -cvzf ola-debian-stable-built-source-tree.tar.gz . |
| 51 | + - name: SHA256 artifact archive |
| 52 | + run: sha256sum ola-debian-stable-built-source-tree.tar.gz |
| 53 | + - uses: actions/upload-artifact@v3 |
| 54 | + with: |
| 55 | + name: ola-debian-stable-built-source-tree |
| 56 | + path: ola-debian-stable-built-source-tree.tar.gz |
| 57 | + check-licences: |
| 58 | + name: Check Licences |
| 59 | + runs-on: ubuntu-latest |
| 60 | + container: debian:stable |
| 61 | + needs: build |
| 62 | + steps: |
| 63 | + - name: Download built source tree archive |
| 64 | + uses: actions/download-artifact@v3 |
| 65 | + with: |
| 66 | + name: ola-debian-stable-built-source-tree |
| 67 | + path: . |
| 68 | + - name: SHA256 artifact archive |
| 69 | + run: sha256sum ola-debian-stable-built-source-tree.tar.gz |
| 70 | + - name: Unarchive artifacts and delete archive |
| 71 | + shell: bash |
| 72 | + run: | |
| 73 | + tar -xvzf ola-debian-stable-built-source-tree.tar.gz . |
| 74 | + rm ola-debian-stable-built-source-tree.tar.gz |
| 75 | + - name: Display structure of extracted files |
| 76 | + if: env.ACTIONS_STEP_DEBUG == 'true' |
| 77 | + run: ls -alR |
| 78 | + - name: Update package database |
| 79 | + run: apt-get update -y |
| 80 | + - name: Install Python |
| 81 | + run: apt-get -y install python3 python-is-python3 |
| 82 | + - name: Enable Problem Matcher for GitHub annotations |
| 83 | + run: echo "::add-matcher::.github/problem-matcher-lint-check-licences.json" |
| 84 | + - name: Check licenses |
| 85 | + shell: bash |
| 86 | + run: ./scripts/enforce_licence.py |
| 87 | + generic-nolints: |
| 88 | + name: Count generic NOLINTs |
| 89 | + runs-on: ubuntu-latest |
| 90 | + container: debian:stable |
| 91 | + needs: build |
| 92 | + steps: |
| 93 | + - name: Download built source tree archive |
| 94 | + uses: actions/download-artifact@v3 |
| 95 | + with: |
| 96 | + name: ola-debian-stable-built-source-tree |
| 97 | + path: . |
| 98 | + - name: SHA256 artifact archive |
| 99 | + run: sha256sum ola-debian-stable-built-source-tree.tar.gz |
| 100 | + - name: Unarchive artifacts and delete archive |
| 101 | + shell: bash |
| 102 | + run: | |
| 103 | + tar -xvzf ola-debian-stable-built-source-tree.tar.gz . |
| 104 | + rm ola-debian-stable-built-source-tree.tar.gz |
| 105 | + - name: Display structure of extracted files |
| 106 | + if: env.ACTIONS_STEP_DEBUG == 'true' |
| 107 | + run: ls -alR |
| 108 | + - name: Enable Problem Matcher for GitHub annotations |
| 109 | + run: echo "::add-matcher::.github/problem-matcher-lint-generic-nolints.json" |
| 110 | + - name: Count the number of generic NOLINTs |
| 111 | + shell: bash |
| 112 | + run: ./scripts/count_generic_nolints.sh |
| 113 | + cpplint: |
| 114 | + name: cpplint |
| 115 | + runs-on: ubuntu-latest |
| 116 | + container: debian:stable |
| 117 | + needs: build |
| 118 | + steps: |
| 119 | + - name: Download built source tree archive |
| 120 | + uses: actions/download-artifact@v3 |
| 121 | + with: |
| 122 | + name: ola-debian-stable-built-source-tree |
| 123 | + path: . |
| 124 | + - name: SHA256 artifact archive |
| 125 | + run: sha256sum ola-debian-stable-built-source-tree.tar.gz |
| 126 | + - name: Unarchive artifacts and delete archive |
| 127 | + shell: bash |
| 128 | + run: | |
| 129 | + tar -xvzf ola-debian-stable-built-source-tree.tar.gz . |
| 130 | + rm ola-debian-stable-built-source-tree.tar.gz |
| 131 | + - name: Display structure of extracted files |
| 132 | + if: env.ACTIONS_STEP_DEBUG == 'true' |
| 133 | + run: ls -alR |
| 134 | + - name: Update package database |
| 135 | + run: apt-get update -y |
| 136 | + - name: Install build tools |
| 137 | + shell: bash |
| 138 | + run: | |
| 139 | + apt-get -y install pkg-config libtool autoconf \ |
| 140 | + automake g++ bison flex make bash-completion dh-autoreconf \ |
| 141 | + debhelper devscripts wget python3-pip |
| 142 | + - name: Install Python lint tools |
| 143 | + run: python3 -m pip install --no-input cpplint flake8 |
| 144 | + - name: Install build dependencies |
| 145 | + shell: bash |
| 146 | + run: | |
| 147 | + apt-get -y install libcppunit-dev uuid-dev libncurses5-dev \ |
| 148 | + libmicrohttpd-dev protobuf-compiler python3-protobuf \ |
| 149 | + libprotobuf-dev libprotoc-dev zlib1g-dev libftdi-dev \ |
| 150 | + libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy |
| 151 | + - name: Enable Problem Matcher for GitHub annotations |
| 152 | + run: echo "::add-matcher::.github/problem-matcher-lint-cpplint.json" |
| 153 | + - name: cpplint |
| 154 | + run: make cpplint VERBOSE=1 |
| 155 | + flake8: |
| 156 | + name: flake8 |
| 157 | + runs-on: ubuntu-latest |
| 158 | + container: debian:stable |
| 159 | + needs: build |
| 160 | + steps: |
| 161 | + - name: Download built source tree archive |
| 162 | + uses: actions/download-artifact@v3 |
| 163 | + with: |
| 164 | + name: ola-debian-stable-built-source-tree |
| 165 | + path: . |
| 166 | + - name: SHA256 artifact archive |
| 167 | + run: sha256sum ola-debian-stable-built-source-tree.tar.gz |
| 168 | + - name: Unarchive artifacts and delete archive |
| 169 | + shell: bash |
| 170 | + run: | |
| 171 | + tar -xvzf ola-debian-stable-built-source-tree.tar.gz . |
| 172 | + rm ola-debian-stable-built-source-tree.tar.gz |
| 173 | + - name: Display structure of extracted files |
| 174 | + if: env.ACTIONS_STEP_DEBUG == 'true' |
| 175 | + run: ls -alR |
| 176 | + - name: Update package database |
| 177 | + run: apt-get update -y |
| 178 | + - name: Install build tools |
| 179 | + shell: bash |
| 180 | + run: | |
| 181 | + apt-get -y install pkg-config libtool autoconf \ |
| 182 | + automake g++ bison flex make bash-completion dh-autoreconf \ |
| 183 | + debhelper devscripts wget python3-pip |
| 184 | + - name: Install Python lint tools |
| 185 | + run: python3 -m pip install --no-input cpplint flake8 |
| 186 | + - name: Setup flake8 annotations |
| 187 | + uses: rbialon/flake8-annotations@v1 |
| 188 | + - name: Install build dependencies |
| 189 | + shell: bash |
| 190 | + run: | |
| 191 | + apt-get -y install libcppunit-dev uuid-dev libncurses5-dev \ |
| 192 | + libmicrohttpd-dev protobuf-compiler python3-protobuf \ |
| 193 | + libprotobuf-dev libprotoc-dev zlib1g-dev libftdi-dev \ |
| 194 | + libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy |
| 195 | + - name: flake8 |
| 196 | + run: make flake8 VERBOSE=1 |
0 commit comments