diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c8729f..22973de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,22 +4,40 @@ on: [push] jobs: build: + env: + NIM_VERSION: 1.0.2 runs-on: ubuntu-latest steps: + - name: Setup environment + run: echo "::set-env name=NIM_VERSION::$NIM_VERSION" + - uses: actions/checkout@master + - name: Cache choosenim id: cache-choosenim uses: actions/cache@v1 with: path: ~/.choosenim - key: ${{ runner.os }}-choosenim-stable + key: ${{ runner.os }}-choosenim-${{ env.NIM_VERSION }} + - name: Cache nimble id: cache-nimble uses: actions/cache@v1 with: path: ~/.nimble - key: ${{ runner.os }}-nimble-stable - - uses: jiro4989/setup-nim-action@v1.0.1 - - run: nimble test -Y + key: ${{ runner.os }}-nimble-${{ env.NIM_VERSION }} + + - name: Install Nim + if: steps.cache-choosenim.outputs.cache-hit != 'true' || steps.cache-nimble.outputs.cache-hit != 'true' + run: | + export CHOOSENIM_CHOOSE_VERSION="$NIM_VERSION" + curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh + sh init.sh -y + + - name: Run Tests + run: | + export PATH=$HOME/.nimble/bin:$PATH + echo $PATH + nimble test