CI: refactor Nim compiler caching
This commit is contained in:
parent
99e89eb1e5
commit
41a0cc6180
1 changed files with 5 additions and 34 deletions
39
.github/workflows/ci.yml
vendored
39
.github/workflows/ci.yml
vendored
|
|
@ -8,37 +8,18 @@ jobs:
|
||||||
max-parallel: 20
|
max-parallel: 20
|
||||||
matrix:
|
matrix:
|
||||||
branch: [master]
|
branch: [master]
|
||||||
|
test_lang: [c, cpp]
|
||||||
target:
|
target:
|
||||||
- os: linux
|
- os: linux
|
||||||
cpu: amd64
|
cpu: amd64
|
||||||
TEST_LANG: c
|
|
||||||
- os: linux
|
|
||||||
cpu: amd64
|
|
||||||
TEST_LANG: cpp
|
|
||||||
- os: linux
|
- os: linux
|
||||||
cpu: i386
|
cpu: i386
|
||||||
TEST_LANG: c
|
|
||||||
- os: linux
|
|
||||||
cpu: i386
|
|
||||||
TEST_LANG: cpp
|
|
||||||
- os: macos
|
- os: macos
|
||||||
cpu: amd64
|
cpu: amd64
|
||||||
TEST_LANG: c
|
|
||||||
- os: macos
|
|
||||||
cpu: amd64
|
|
||||||
TEST_LANG: cpp
|
|
||||||
- os: windows
|
- os: windows
|
||||||
cpu: amd64
|
cpu: amd64
|
||||||
TEST_LANG: c
|
|
||||||
- os: windows
|
|
||||||
cpu: amd64
|
|
||||||
TEST_LANG: cpp
|
|
||||||
- os: windows
|
- os: windows
|
||||||
cpu: i386
|
cpu: i386
|
||||||
TEST_LANG: c
|
|
||||||
- os: windows
|
|
||||||
cpu: i386
|
|
||||||
TEST_LANG: cpp
|
|
||||||
include:
|
include:
|
||||||
- target:
|
- target:
|
||||||
os: linux
|
os: linux
|
||||||
|
|
@ -50,7 +31,7 @@ jobs:
|
||||||
os: windows
|
os: windows
|
||||||
builder: windows-2019
|
builder: windows-2019
|
||||||
|
|
||||||
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ matrix.target.TEST_LANG }} (${{ matrix.branch }})'
|
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ matrix.test_lang }} (${{ matrix.branch }})'
|
||||||
runs-on: ${{ matrix.builder }}
|
runs-on: ${{ matrix.builder }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout nim-faststreams
|
- name: Checkout nim-faststreams
|
||||||
|
|
@ -145,11 +126,10 @@ jobs:
|
||||||
id: nim-cache
|
id: nim-cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: nim
|
path: NimBinaries
|
||||||
key: 'nim-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.nimbus_build_system }}'
|
key: 'NimBinaries-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.nimbus_build_system }}'
|
||||||
|
|
||||||
- name: Build Nim and associated tools
|
- name: Build Nim and associated tools
|
||||||
if: steps.nim-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh
|
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh
|
||||||
|
|
@ -165,15 +145,6 @@ jobs:
|
||||||
fi
|
fi
|
||||||
env MAKE="$MAKE_CMD -j2" ARCH_OVERRIDE=$PLATFORM CC=gcc bash build_nim.sh nim csources dist/nimble NimBinaries
|
env MAKE="$MAKE_CMD -j2" ARCH_OVERRIDE=$PLATFORM CC=gcc bash build_nim.sh nim csources dist/nimble NimBinaries
|
||||||
|
|
||||||
# clean up to save cache space
|
|
||||||
cd nim
|
|
||||||
rm koch
|
|
||||||
rm -rf nimcache
|
|
||||||
rm -rf csources
|
|
||||||
rm -rf tests
|
|
||||||
rm -rf dist
|
|
||||||
rm -rf .git
|
|
||||||
|
|
||||||
- name: Setup environment
|
- name: Setup environment
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
|
run: echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
|
||||||
|
|
@ -183,4 +154,4 @@ jobs:
|
||||||
working-directory: nim-faststreams
|
working-directory: nim-faststreams
|
||||||
run: |
|
run: |
|
||||||
nimble install -y --depsOnly
|
nimble install -y --depsOnly
|
||||||
env TEST_LANG="${{ matrix.target.TEST_LANG }}" nimble test
|
env TEST_LANG="${{ matrix.test_lang }}" nimble test
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue