From d93c65ec60eead65a44d14e75d36c0bd8885e634 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Mon, 11 Mar 2024 08:15:59 +0100 Subject: [PATCH] refresh CI --- .github/workflows/ci.yml | 58 ++++++++++------------------------------ 1 file changed, 14 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f4c816..39b4520 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,12 @@ name: CI -on: [push, pull_request] + push: + branches: + - master + pull_request: + workflow_dispatch: + inputs: + branch: + default: stable concurrency: # Cancel stale PR builds (but not push builds) group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} @@ -17,11 +24,10 @@ jobs: - os: linux cpu: amd64 TEST_LANG: cpp - branch: [version-1-2, version-1-4, version-1-6, version-2-0, devel] + branch: ${{ fromJSON(format('[{0}]', inputs.branch || '"1.2.x","1.4.x","1.6.x","2.0.x", "devel"')) }} include: - target: os: linux - builder: ubuntu-20.04 shell: bash defaults: run: @@ -31,48 +37,12 @@ jobs: runs-on: ${{ matrix.builder }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Derive environment variables - shell: bash - run: | - if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then - ARCH=64 - PLATFORM=x64 - else - ARCH=32 - PLATFORM=x86 - fi - echo "ARCH=$ARCH" >> $GITHUB_ENV - echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV - - if [[ '${{ matrix.target.os }}' == 'windows' ]]; then - MAKE_CMD="mingw32-make" - else - MAKE_CMD="make" - fi - echo "MAKE_CMD=$MAKE_CMD" >> $GITHUB_ENV - - 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 - echo "ncpu=$ncpu" >> $GITHUB_ENV - - - name: Build the Nim compiler - run: | - curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh - env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} CC=gcc NIM_COMMIT=${{ matrix.branch }} bash build_nim.sh nim csources dist/nimble NimBinaries - echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH + - uses: jiro4989/setup-nim-action@v1 + with: + nim-version: ${{ matrix.nim }} + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Run tests run: |