reverting to 1.4.6 as otherwise it fails on amd64

This commit is contained in:
Dmitriy Ryajov 2021-10-29 12:46:19 -06:00
parent 9861776233
commit d6347e8a57
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 72 additions and 19 deletions

View File

@ -7,42 +7,45 @@ jobs:
fail-fast: false fail-fast: false
max-parallel: 20 max-parallel: 20
matrix: matrix:
branch: [v1.4.6]
target: target:
# Unit tests # Unit tests
- os: linux - os: linux
cpu: amd64 cpu: amd64
TEST_KIND: unit-tests
- os: linux - os: linux
cpu: i386 cpu: i386
TEST_KIND: unit-tests
- os: macos - os: macos
cpu: amd64 cpu: amd64
TEST_KIND: unit-tests
- os: windows - os: windows
cpu: i386 cpu: i386
TEST_KIND: unit-tests
- os: windows - os: windows
cpu: amd64 cpu: amd64
TEST_KIND: unit-tests
include: include:
- target: - target:
os: linux os: linux
builder: ubuntu-20.04 builder: ubuntu-18.04
- target: - target:
os: macos os: macos
builder: macos-10.15 builder: macos-10.15
- target: - target:
os: windows os: windows
builder: windows-2019 builder: windows-2019
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (${{ matrix.branch }})'
defaults:
run:
shell: bash
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}'
runs-on: ${{ matrix.builder }} runs-on: ${{ matrix.builder }}
steps: steps:
- name: Checkout nim-dagger - name: Checkout nim-dagger
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: nim-dagger
submodules: true submodules: true
- name: Derive environment variables - name: Derive environment variables
shell: bash
run: | run: |
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then
ARCH=64 ARCH=64
@ -53,10 +56,8 @@ jobs:
fi fi
echo "ARCH=$ARCH" >> $GITHUB_ENV echo "ARCH=$ARCH" >> $GITHUB_ENV
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
ncpu= ncpu=
ext= ext=
MAKE_CMD="make"
case '${{ runner.os }}' in case '${{ runner.os }}' in
'Linux') 'Linux')
ncpu=$(nproc) ncpu=$(nproc)
@ -67,13 +68,11 @@ jobs:
'Windows') 'Windows')
ncpu=$NUMBER_OF_PROCESSORS ncpu=$NUMBER_OF_PROCESSORS
ext=.exe ext=.exe
MAKE_CMD="mingw32-make"
;; ;;
esac esac
[[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
echo "ncpu=$ncpu" >> $GITHUB_ENV echo "ncpu=$ncpu" >> $GITHUB_ENV
echo "ext=$ext" >> $GITHUB_ENV echo "ext=$ext" >> $GITHUB_ENV
echo "MAKE_CMD=${MAKE_CMD}" >> $GITHUB_ENV
- name: Install build dependencies (Linux i386) - name: Install build dependencies (Linux i386)
if: runner.os == 'Linux' && matrix.target.cpu == 'i386' if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
@ -115,6 +114,7 @@ jobs:
if: > if: >
steps.windows-mingw-cache.outputs.cache-hit != 'true' && steps.windows-mingw-cache.outputs.cache-hit != 'true' &&
runner.os == 'Windows' runner.os == 'Windows'
shell: bash
run: | run: |
mkdir -p external mkdir -p external
curl -L "https://nim-lang.org/download/mingw$ARCH.7z" -o "external/mingw-${{ matrix.target.cpu }}.7z" curl -L "https://nim-lang.org/download/mingw$ARCH.7z" -o "external/mingw-${{ matrix.target.cpu }}.7z"
@ -125,6 +125,7 @@ jobs:
if: > if: >
steps.windows-dlls-cache.outputs.cache-hit != 'true' && steps.windows-dlls-cache.outputs.cache-hit != 'true' &&
runner.os == 'Windows' runner.os == 'Windows'
shell: bash
run: | run: |
mkdir -p external mkdir -p external
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
@ -133,33 +134,85 @@ jobs:
- name: Path to cached dependencies (Windows) - name: Path to cached dependencies (Windows)
if: > if: >
runner.os == 'Windows' runner.os == 'Windows'
shell: bash
run: | run: |
echo "${{ github.workspace }}/external/mingw-${{ matrix.target.cpu }}/bin" >> $GITHUB_PATH echo "${{ github.workspace }}/external/mingw-${{ matrix.target.cpu }}/bin" >> $GITHUB_PATH
echo "${{ github.workspace }}/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH echo "${{ github.workspace }}/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH
- name: Setup environment
shell: bash
run: echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
- name: Get latest Nim commit hash - name: Get latest Nim commit hash
id: versions id: versions
shell: bash
run: | run: |
getHash() { getHash() {
git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1 git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1
} }
nbsHash=$(getHash status-im/nimbus-build-system) nimHash=$(getHash nim-lang/Nim '${{ matrix.branch }}')
echo "::set-output name=nimbus_build_system::$nbsHash" csourcesHash=$(getHash nim-lang/csources)
echo "::set-output name=nim::$nimHash"
echo "::set-output name=csources::$csourcesHash"
- name: Restore prebuilt Nim from cache - name: Restore prebuilt Nim from cache
id: nim-cache id: nim-cache
uses: actions/cache@v2 uses: actions/cache@v1
with: with:
path: NimBinaries path: nim
key: 'NimBinaries-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.nimbus_build_system }}' key: "nim-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.nim }}"
- name: Restore prebuilt csources from cache
if: steps.nim-cache.outputs.cache-hit != 'true'
id: csources-cache
uses: actions/cache@v1
with:
path: csources/bin
key: "csources-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.csources }}"
- name: Checkout Nim csources
if: >
steps.csources-cache.outputs.cache-hit != 'true' &&
steps.nim-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: nim-lang/csources
path: csources
ref: ${{ steps.versions.outputs.csources }}
- name: Checkout Nim
if: steps.nim-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: nim-lang/Nim
path: nim
ref: ${{ steps.versions.outputs.nim }}
- name: Build Nim and associated tools - name: Build Nim and associated tools
if: steps.nim-cache.outputs.cache-hit != 'true'
shell: bash
run: | run: |
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} CC=gcc bash build_nim.sh nim csources dist/nimble NimBinaries if [[ ! -e csources/bin/nim$ext ]]; then
echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH make -C csources -j $ncpu CC=gcc ucpu='${{ matrix.target.cpu }}'
else
echo 'Using prebuilt csources'
fi
cp -v csources/bin/nim$ext nim/bin
cd nim
nim c koch
./koch boot -d:release
./koch tools -d:release
# clean up to save cache space
rm koch
rm -rf nimcache
rm -rf dist
rm -rf .git
- name: Run nim-dagger tests - name: Run nim-dagger tests
shell: bash
run: | run: |
export UCPU="$cpu"
cd nim-dagger
nimble install -y --depsOnly nimble install -y --depsOnly
nimble test nimble test