|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ release ] |
| 6 | + pull_request: |
| 7 | + branches: [ dev, release ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + |
| 11 | + |
| 12 | + build: |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + lua_ver: [51, 53] |
| 17 | + numbers: ['float'] |
| 18 | + include: |
| 19 | + - lua_ver: 51 |
| 20 | + numbers: 'integral' |
| 21 | + - lua_ver: 53 |
| 22 | + numbers: '64bit' |
| 23 | + runs-on: ubuntu-16.04 |
| 24 | + |
| 25 | + env: |
| 26 | + LUA: ${{ matrix.lua_ver }} |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v2 |
| 30 | + with: |
| 31 | + submodules: true |
| 32 | + - run: pip install pyserial |
| 33 | + shell: bash |
| 34 | + - run: sudo apt install srecord |
| 35 | + shell: bash |
| 36 | + - name: Build firmware |
| 37 | + if: matrix.numbers == 'float' |
| 38 | + run: make |
| 39 | + shell: bash |
| 40 | + - name: Build integral firmware |
| 41 | + if: ${{ matrix.numbers == 'integral' }} |
| 42 | + run: | |
| 43 | + make EXTRA_CCFLAGS="-DLUA_NUMBER_INTEGRAL" |
| 44 | + mv luac.cross.int luac.cross |
| 45 | + shell: bash |
| 46 | + - name: Build 64bit firmware |
| 47 | + if: ${{ matrix.numbers == '64bit' }} |
| 48 | + run: | |
| 49 | + make EXTRA_CCFLAGS="-DLUA_NUMBER_64BITS" |
| 50 | + shell: bash |
| 51 | + - name: Upload luac.cross |
| 52 | + if: ${{ success() }} |
| 53 | + uses: actions/upload-artifact@v2 |
| 54 | + with: |
| 55 | + name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }} |
| 56 | + path: luac.cross |
| 57 | + |
| 58 | + |
| 59 | + build_luac_cross_win: |
| 60 | + |
| 61 | + runs-on: windows-latest |
| 62 | + |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v2 |
| 65 | + with: |
| 66 | + submodules: true |
| 67 | + - name: Build luac.cross.exe |
| 68 | + run: | |
| 69 | + set |
| 70 | + "%programfiles%\git\usr\bin\xargs" |
| 71 | + cd msvc |
| 72 | + "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" /p:Configuration=Release /p:Platform=x64 |
| 73 | + mv luac-cross/x64/Release/luac.cross.exe .. |
| 74 | + shell: cmd |
| 75 | + - name: Upload luac.cross |
| 76 | + if: ${{ success() }} |
| 77 | + uses: actions/upload-artifact@v2 |
| 78 | + with: |
| 79 | + name: luac.cross_51_float_win |
| 80 | + path: luac.cross.exe |
| 81 | + |
| 82 | + |
| 83 | + compile_lua: |
| 84 | + |
| 85 | + strategy: |
| 86 | + fail-fast: false |
| 87 | + matrix: |
| 88 | + lua_ver: [51, 53] |
| 89 | + numbers: ['float'] |
| 90 | + filter: [ 'cat' ] |
| 91 | + include: |
| 92 | + - lua_ver: 51 |
| 93 | + numbers: 'integral' |
| 94 | + filter: 'grep -v "lua_modules/lm92/lm92.lua\|lua_modules/hdc1000/HDC1000.lua\|lua_examples/u8g2/graphics_test.lua"' |
| 95 | + - lua_ver: 53 |
| 96 | + numbers: '64bit' |
| 97 | + filter: 'cat' |
| 98 | + needs: build |
| 99 | + runs-on: ubuntu-16.04 |
| 100 | + |
| 101 | + steps: |
| 102 | + - name: Checkout repo |
| 103 | + uses: actions/checkout@v2 |
| 104 | + with: |
| 105 | + submodules: false |
| 106 | + - name: Download luac.cross |
| 107 | + uses: actions/download-artifact@v1 |
| 108 | + with: |
| 109 | + name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }} |
| 110 | + path: ./ |
| 111 | + - name: Fix file permission |
| 112 | + run: chmod +x luac.cross |
| 113 | + - name: compile Lua |
| 114 | + run: | |
| 115 | + find lua_modules lua_examples tests/NTest* -iname "*.lua" | ${{ matrix.filter }} | xargs --delimiter="\n" echo |
| 116 | + find lua_modules lua_examples tests/NTest* -iname "*.lua" | ${{ matrix.filter }} | xargs --delimiter="\n" ./luac.cross -p |
| 117 | + shell: bash |
| 118 | + |
| 119 | + |
| 120 | + compile_lua_win: |
| 121 | + |
| 122 | + strategy: |
| 123 | + fail-fast: false |
| 124 | + matrix: |
| 125 | + lua_ver: [51] |
| 126 | + numbers: ['float'] |
| 127 | + filter: [ 'cat' ] |
| 128 | + needs: build_luac_cross_win |
| 129 | + runs-on: windows-latest |
| 130 | + |
| 131 | + steps: |
| 132 | + - name: Checkout repo |
| 133 | + uses: actions/checkout@v2 |
| 134 | + with: |
| 135 | + submodules: false |
| 136 | + - name: Download luac.cross |
| 137 | + uses: actions/download-artifact@v1 |
| 138 | + with: |
| 139 | + name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }}_win |
| 140 | + path: ./ |
| 141 | + - name: compile Lua |
| 142 | + run: | |
| 143 | + PATH="/C/Program\ Files/Git/usr/bin:${PATH}" |
| 144 | + find lua_modules lua_examples tests/NTest* -iname "*.lua" | ${{ matrix.filter }} | xargs --delimiter="\n" echo |
| 145 | + find lua_modules lua_examples tests/NTest* -iname "*.lua" | ${{ matrix.filter }} | xargs --delimiter="\n" ./luac.cross -p |
| 146 | + shell: bash |
| 147 | + |
| 148 | + |
| 149 | + NTest: |
| 150 | + |
| 151 | + strategy: |
| 152 | + fail-fast: false |
| 153 | + matrix: |
| 154 | + lua_ver: [51, 53] |
| 155 | + numbers: ['float'] |
| 156 | + include: |
| 157 | + - lua_ver: 51 |
| 158 | + numbers: 'integral' |
| 159 | + - lua_ver: 53 |
| 160 | + numbers: '64bit' |
| 161 | + needs: build |
| 162 | + runs-on: ubuntu-16.04 |
| 163 | + |
| 164 | + steps: |
| 165 | + - name: Checkout repo |
| 166 | + uses: actions/checkout@v2 |
| 167 | + with: |
| 168 | + submodules: false |
| 169 | + - name: Download luac.cross |
| 170 | + uses: actions/download-artifact@v1 |
| 171 | + with: |
| 172 | + name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }} |
| 173 | + path: ./ |
| 174 | + - name: Fix file permission |
| 175 | + run: chmod +x luac.cross |
| 176 | + - name: NTest selfcheck |
| 177 | + run: | |
| 178 | + cd tests/NTest |
| 179 | + ../../luac.cross -e ../NTest/NTest_NTest.lua | tee log |
| 180 | + grep "failed. 0" log |
| 181 | + shell: bash |
| 182 | + - name: NTest hosttests |
| 183 | + run: | |
| 184 | + cd tests |
| 185 | + cp NTest/NTest.lua . |
| 186 | + ../luac.cross -e NTest_lua.lua | tee log |
| 187 | + (if grep " ==> " log ; then exit 1 ; fi) |
| 188 | + shell: bash |
| 189 | + |
| 190 | + |
| 191 | + NTest_win: |
| 192 | + |
| 193 | + strategy: |
| 194 | + fail-fast: false |
| 195 | + matrix: |
| 196 | + lua_ver: [51] |
| 197 | + numbers: ['float'] |
| 198 | + needs: build_luac_cross_win |
| 199 | + runs-on: windows-latest |
| 200 | + |
| 201 | + steps: |
| 202 | + - name: Checkout repo |
| 203 | + uses: actions/checkout@v2 |
| 204 | + with: |
| 205 | + submodules: false |
| 206 | + - name: Download luac.cross |
| 207 | + uses: actions/download-artifact@v1 |
| 208 | + with: |
| 209 | + name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }}_win |
| 210 | + path: ./ |
| 211 | + - name: NTest selfcheck |
| 212 | + run: | |
| 213 | + cd tests/NTest |
| 214 | + ../../luac.cross.exe -e ../NTest/NTest_NTest.lua | tee log |
| 215 | + grep "failed. 0" log |
| 216 | + shell: bash |
| 217 | + - name: NTest hosttests |
| 218 | + run: | |
| 219 | + cd tests |
| 220 | + cp NTest/NTest.lua . |
| 221 | + ../luac.cross.exe -e NTest_lua.lua | tee log |
| 222 | + (if grep " ==> " log ; then exit 1 ; fi) |
| 223 | + shell: bash |
| 224 | + |
| 225 | + |
| 226 | + luacheck: |
| 227 | + |
| 228 | + strategy: |
| 229 | + fail-fast: false |
| 230 | + matrix: |
| 231 | + include: |
| 232 | + - os: 'linux' |
| 233 | + vm: 'ubuntu-16.04' |
| 234 | + - os: 'windows' |
| 235 | + vm: 'windows-latest' |
| 236 | + runs-on: ${{ matrix.vm }} |
| 237 | + |
| 238 | + steps: |
| 239 | + - uses: actions/checkout@v2 |
| 240 | + with: |
| 241 | + submodules: false |
| 242 | + - run: sudo apt install luarocks |
| 243 | + if : matrix.os == 'linux' |
| 244 | + shell: bash |
| 245 | + - name: get luacheck.exe # is also done in the travis script but in this action it does not run in bash |
| 246 | + if : matrix.os == 'windows' |
| 247 | + run: | |
| 248 | + mkdir cache |
| 249 | + C:msys64\usr\bin\wget.exe --tries=5 --timeout=10 --waitretry=10 --read-timeout=10 --retry-connrefused -O cache/luacheck.exe https://github.com/mpeterv/luacheck/releases/download/0.23.0/luacheck.exe |
| 250 | + shell: cmd |
| 251 | + - name: luacheck |
| 252 | + run: | |
| 253 | + PATH="/C/Program\ Files/Git/usr/bin:${PATH}" |
| 254 | + ./tools/travis/run-luacheck-${{ matrix.os }}.sh |
| 255 | + shell: bash |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + doc_check: |
| 260 | + |
| 261 | + strategy: |
| 262 | + fail-fast: false |
| 263 | + runs-on: ubuntu-16.04 |
| 264 | + |
| 265 | + steps: |
| 266 | + - uses: actions/checkout@v2 |
| 267 | + with: |
| 268 | + submodules: false |
| 269 | + - name: all_modules_linked |
| 270 | + run: ./tools/check_docs_module_linkage.sh |
| 271 | + shell: bash |
| 272 | + |
0 commit comments