forked from flyx/NimYAML
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from status-im/nim12devel
Nim-1.2.x support
- Loading branch information
Showing
2,274 changed files
with
10,331 additions
and
3,987 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
name: NimYAML CI | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 20 | ||
matrix: | ||
target: | ||
- os: linux | ||
cpu: amd64 | ||
- os: linux | ||
cpu: i386 | ||
- os: macos | ||
cpu: amd64 | ||
- os: windows | ||
cpu: amd64 | ||
branch: [version-1-2, version-1-4, devel] | ||
include: | ||
- target: | ||
os: linux | ||
builder: ubuntu-18.04 | ||
- target: | ||
os: macos | ||
builder: macos-10.15 | ||
- target: | ||
os: windows | ||
builder: windows-2019 | ||
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})' | ||
runs-on: ${{ matrix.builder }} | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: NimYAML | ||
|
||
- 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: Install build dependencies (Linux i386) | ||
if: runner.os == 'Linux' && matrix.target.cpu == 'i386' | ||
run: | | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-fast update -qq | ||
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \ | ||
--no-install-recommends -yq gcc-multilib g++-multilib | ||
mkdir -p external/bin | ||
cat << EOF > external/bin/gcc | ||
#!/bin/bash | ||
exec $(which gcc) -m32 -mno-adx "\$@" | ||
EOF | ||
cat << EOF > external/bin/g++ | ||
#!/bin/bash | ||
exec $(which g++) -m32 -mno-adx "\$@" | ||
EOF | ||
chmod 755 external/bin/gcc external/bin/g++ | ||
echo "${{ github.workspace }}/external/bin" >> $GITHUB_PATH | ||
- name: Restore MinGW-W64 (Windows) from cache | ||
if: runner.os == 'Windows' | ||
id: windows-mingw-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: external/mingw-${{ matrix.target.cpu }} | ||
key: 'mingw-${{ matrix.target.cpu }}' | ||
|
||
- name: Restore Nim DLLs dependencies (Windows) from cache | ||
if: runner.os == 'Windows' | ||
id: windows-dlls-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: external/dlls-${{ matrix.target.cpu }} | ||
key: 'dlls-${{ matrix.target.cpu }}' | ||
|
||
- name: Install MinGW64 dependency (Windows) | ||
if: > | ||
steps.windows-mingw-cache.outputs.cache-hit != 'true' && | ||
runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
mkdir -p external | ||
curl -L "https://nim-lang.org/download/mingw$ARCH-6.3.0.7z" -o "external/mingw-${{ matrix.target.cpu }}.7z" | ||
7z x -y "external/mingw-${{ matrix.target.cpu }}.7z" -oexternal/ | ||
mv external/mingw$ARCH external/mingw-${{ matrix.target.cpu }} | ||
- name: Install DLLs dependencies (Windows) | ||
if: > | ||
steps.windows-dlls-cache.outputs.cache-hit != 'true' && | ||
runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
mkdir -p external | ||
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip | ||
7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }} | ||
- name: Path to cached dependencies (Windows) | ||
if: > | ||
runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
echo "${{ github.workspace }}/external/mingw-${{ matrix.target.cpu }}/bin" >> $GITHUB_PATH | ||
echo "${{ github.workspace }}/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH | ||
- name: Build the Nim compiler | ||
shell: bash | ||
run: | | ||
git clone -b ${{ matrix.branch }} --depth 1 git://github.com/nim-lang/nim nim/ | ||
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 QUICK_AND_DIRTY_COMPILER=1 bash build_nim.sh nim csources dist/nimble NimBinaries | ||
echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH | ||
- name: Run tests | ||
shell: bash | ||
working-directory: NimYAML | ||
run: | | ||
nim lexerTests | ||
if [[ '${{ matrix.target.os }}' != 'windows' ]]; then | ||
nim parserTests | ||
nim quickstartTests | ||
fi | ||
nim jsonTests | ||
nim domTests | ||
nim serializationTests | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.