setup-nim icon indicating copy to clipboard operation
setup-nim copied to clipboard

CI helpers to setup Nim using prebuilt nightlies

Setup Nim

Check shell scripts Test Github Actions

An action for setting up the Nim environment for use within Github Actions. This includes:

Usage

See action.yml

Note: It is recommended to use a tagged version at the moment instead of master. This makes sure that future backward-incompatible changes will not cause your CI to fail suddenly. See the Update section for how to keep the action up-to-date.

Basic:

steps:
  - uses: alaviss/[email protected]
    with:
      version: 'version-1-4' # The Nim nightly version branch to download
      path: 'nim' # The directory relative to ${{ github.workspace }} to
                  # store the downloaded toolchain
  - uses: actions/checkout@v2
  - run: nimble build

Matrix testing:

jobs:
  test:
    strategy:
      matrix:
        os: ['windows-latest', 'macos-latest', 'ubuntu-latest']
        nim: ['devel', 'version-1-4', 'version-1-0']

    name: Nim ${{ matrix.nim }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: alaviss/[email protected]
        with:
          path: 'nim'
          version: ${{ matrix.nim }}
      - run: nimble test

Testing 32bit Windows:

jobs:
  test:
    name: Nim 32bit on Windows
    runs-on: windows-latest

    steps:
      - uses: actions/checkout@v2
      - uses: egor-tensin/setup-mingw@v1
        with:
          platform: x86
      - uses: alaviss/[email protected]
        with:
          path: 'nim'
          version: devel
          architecture: i386
      - run: nimble test

Update

Github's Dependabot can be used to keep actions up-to-date, see here for more information.

Example .github/dependabot.yml (copied from Github Docs):

version: 2

updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      # Check for updates to GitHub Actions every weekday
      interval: "daily"

License

Unless stated otherwise, scripts and documentations within this project are released under the GNU GPLv3 license.