diff options
author | narimiran <narimiran@disroot.org> | 2020-04-28 10:43:04 +0200 |
---|---|---|
committer | narimiran <narimiran@disroot.org> | 2020-04-28 18:14:34 +0200 |
commit | d5ed4fba3e9225e687d916fd4129e3c61550e193 (patch) | |
tree | 1d2cf0294aaabe76311e4fdd10189813b18c1f4c /.github | |
parent | 289d48e5fe8b0a53cb8d11f4ca4a1183e9752e59 (diff) | |
download | Nim-d5ed4fba3e9225e687d916fd4129e3c61550e193.tar.gz |
test packages with Github workflows
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/ci_packages.yml | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/.github/workflows/ci_packages.yml b/.github/workflows/ci_packages.yml new file mode 100644 index 000000000..1958d4b8d --- /dev/null +++ b/.github/workflows/ci_packages.yml @@ -0,0 +1,82 @@ +name: Packages CI +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + os: [ubuntu-18.04, macos-10.15] + cpu: [amd64] + pkg: [true] + name: '${{ matrix.os }} (pkg: ${{ matrix.pkg }})' + runs-on: ${{ matrix.os }} + env: + NIM_TEST_PACKAGES: ${{ matrix.pkg }} + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + - name: 'Checkout csources' + uses: actions/checkout@v2 + with: + repository: nim-lang/csources + path: csources + + - name: 'Install node.js 12.x' + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - name: 'Install dependencies (Linux amd64)' + if: runner.os == 'Linux' && matrix.cpu == 'amd64' + run: | + sudo apt-fast update -qq + DEBIAN_FRONTEND='noninteractive' \ + sudo apt-fast install --no-install-recommends -yq \ + libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \ + valgrind libc6-dbg + - name: 'Install dependencies (macOS)' + if: runner.os == 'macOS' + run: brew install boehmgc make sfml + - name: 'Install dependencies (Windows)' + if: runner.os == 'Windows' + shell: bash + run: | + mkdir dist + curl -L https://nim-lang.org/download/mingw64.7z -o dist/mingw64.7z + curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip + 7z x dist/mingw64.7z -odist + 7z x dist/dlls.zip -obin + echo "::add-path::${{ github.workspace }}/dist/mingw64/bin" + + - name: 'Add build binaries to PATH' + shell: bash + run: echo "::add-path::${{ github.workspace }}/bin" + + - name: 'Build csources' + shell: bash + run: | + ncpu= + case '${{ runner.os }}' in + 'Linux') + ncpu=$(nproc) + ;; + 'macOS') + ncpu=$(sysctl -n hw.ncpu) + ;; + 'Windows') + ncpu=$NUMBER_OF_PROCESSORS + ;; + esac + [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 + + make -C csources -j $ncpu CC=gcc ucpu='${{ matrix.cpu }}' + - name: 'Build koch' + shell: bash + run: nim c koch + - name: 'Run CI' + shell: bash + run: ./koch runCI + + - name: 'Show failed tests' + if: failure() + shell: bash + run: nim c -r tools/ci_testresults.nim |