Skip to content

Commit

Permalink
CI: refactor Nim compiler caching (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefantalpalaru committed Jun 3, 2021
1 parent 6036a47 commit ab4ba1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 41 deletions.
47 changes: 7 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: nim-confutils CI
name: CI
on: [push, pull_request]

jobs:
Expand All @@ -7,38 +7,17 @@ jobs:
fail-fast: false
max-parallel: 20
matrix:
branch: [master]
target:
- os: linux
cpu: amd64
TEST_LANG: c
- os: linux
cpu: amd64
TEST_LANG: cpp
- os: linux
cpu: i386
TEST_LANG: c
- os: linux
cpu: i386
TEST_LANG: cpp
- os: macos
cpu: amd64
TEST_LANG: c
- os: macos
cpu: amd64
TEST_LANG: cpp
- os: windows
cpu: amd64
TEST_LANG: c
- os: windows
cpu: amd64
TEST_LANG: cpp
- os: windows
cpu: i386
TEST_LANG: c
- os: windows
cpu: i386
TEST_LANG: cpp
include:
- target:
os: linux
Expand All @@ -50,7 +29,7 @@ jobs:
os: windows
builder: windows-2019

name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ matrix.target.TEST_LANG }} (${{ matrix.branch }})'
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}'
runs-on: ${{ matrix.builder }}
steps:
- name: Checkout nim-confutils
Expand Down Expand Up @@ -145,11 +124,10 @@ jobs:
id: nim-cache
uses: actions/cache@v2
with:
path: nim
key: 'nim-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.nimbus_build_system }}'
path: NimBinaries
key: 'NimBinaries-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.nimbus_build_system }}'

- name: Build Nim and associated tools
if: steps.nim-cache.outputs.cache-hit != 'true'
shell: bash
run: |
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh
Expand All @@ -164,24 +142,13 @@ jobs:
MAKE_CMD="make"
fi
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
shell: bash
run: echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
- name: Run nim-confutils tests
shell: bash
working-directory: nim-confutils
run: |
nimble install -y --depsOnly
nimble install -y toml_serialization json_serialization
env TEST_LANG="${{ matrix.target.TEST_LANG }}" nimble test
nimble test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ nim-confutils
[![Build Status](https://travis-ci.org/status-im/nim-confutils.svg?branch=master)](https://travis-ci.org/status-im/nim-confutils)
[![License: Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Github action](https://github.com/status-im/nim-confutils/workflows/nim-confutils%20CI/badge.svg)
![Github action](https://github.com/status-im/nim-confutils/workflows/CI/badge.svg)

## Introduction

Expand Down

0 comments on commit ab4ba1c

Please sign in to comment.