Update various dependencies #153
Workflow file for this run
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
# yamllint disable rule:line-length | |
name: build | |
# yamllint disable rule:truthy | |
on: | |
pull_request: | |
branches: ["*"] | |
paths: | |
- .github/workflows/build.yml # changes to this file | |
- bin/** # changes to asdf entrypoint scripts | |
- lib/** # changes to library functions | |
- share/** # changes to data files | |
- shims/** # changes to shim scripts | |
- test/** # changes to tests | |
- package*.json # bats upgrade | |
push: | |
branches: ["main"] | |
tags: ["*"] | |
paths: | |
- .github/workflows/build.yml # changes to this file | |
- bin/** # changes to asdf entrypoint scripts | |
- lib/** # changes to library functions | |
- share/** # changes to data files | |
- shims/** # changes to shim scripts | |
- test/** # changes to tests | |
- package*.json # bats upgrade | |
# yamllint enable rule:truthy | |
jobs: | |
# Run tests with bats | |
bats_tests: | |
name: Bats tests | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout plugin | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- name: Run tests | |
run: | | |
npm install --include=dev | |
[ -n "$(which bats)" ] || npm link bats | |
npm run test -- --jobs 4 | |
plugin_test_x86: | |
name: 👑${{ matrix.nim-version }}/${{ matrix.platform }}/x86_64 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Stable binary | |
- os: ubuntu-latest | |
nim-version: "latest:1.6" | |
platform: linux-glibc | |
# Stable binary | |
- os: ubuntu-latest | |
nim-version: "latest:2.2" | |
platform: linux-glibc | |
# Unstable binary | |
- os: ubuntu-latest | |
nim-version: "ref:version-2-0" | |
platform: linux-glibc | |
# Unstable binary | |
- os: macos-latest | |
nim-version: "ref:devel" | |
platform: macOS | |
# Build from source | |
- os: ubuntu-latest | |
nim-version: "ref:HEAD" | |
platform: linux-glibc | |
# Build from source | |
- os: macos-latest | |
nim-version: "latest:2.2" | |
platform: macOS | |
steps: | |
# Optimization: re-use cached Nim->C compilation | |
- name: Restore cache | |
if: matrix.nim-version != 'ref:HEAD' && matrix.nim-version != 'latest' | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: cache-${{ matrix.os }}-${{ matrix.nim-version }} | |
- name: Upgrade bash | |
if: runner.os == 'macOS' | |
run: brew install bash parallel | |
- name: Install asdf | |
uses: asdf-vm/actions/setup@v3 | |
- name: Checkout plugin | |
uses: actions/checkout@v4 | |
- name: Install asdf-nim & test | |
shell: bash | |
run: | | |
set -ueo pipefail | |
asdf plugin test nim . \ | |
--asdf-tool-version \ | |
"${{ matrix.nim-version }}" \ | |
--asdf-plugin-gitref \ | |
"${GITHUB_SHA}" \ | |
nim -v | |
# Test musl installation | |
plugin_test_x86_musl: | |
name: 👑2.2.x/linux-musl/x86_64 | |
runs-on: ubuntu-latest | |
container: alpine:latest | |
steps: | |
# Optimization: re-use cached Nim->C compilation | |
- name: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: cache-ubuntu-latest-${{ matrix.nim-version }} | |
- name: Install dependencies | |
run: apk add --update --no-cache --upgrade bash git curl coreutils tar xz grep build-base | |
- name: Test plugin | |
uses: asdf-vm/actions/plugin-test@v1 | |
with: | |
command: nim -v | |
version: "latest:2.2" | |
# Test installation for a few non-x86 architectures | |
plugin_test_non_x86: | |
name: 👑${{ matrix.nim-version }}/linux-glibc/${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Unstable binary | |
- runs-on: ubuntu-latest | |
nim-version: "ref:version-2-2" | |
arch: aarch64 | |
# Unstable binary | |
- runs-on: ubuntu-latest | |
nim-version: "ref:version-1-6" | |
arch: armv7 | |
steps: | |
# Optimization: re-use cached Nim->C compilation | |
- name: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: cache-${{ matrix.arch }}-${{ matrix.nim-version }} | |
- name: Checkout plugin | |
uses: actions/checkout@v4 | |
# Install & run tests on non-x86 | |
- uses: uraimo/run-on-arch-action@v2 | |
name: Install Nim & run tests | |
with: | |
arch: ${{ matrix.arch }} | |
distro: buster | |
dockerRunArgs: | | |
--volume "${HOME}/.cache:/root/.cache" | |
setup: mkdir -p "${HOME}/.cache" | |
shell: /usr/bin/env bash | |
install: | | |
apt-get update -q -y | |
apt-get -qq install -y curl git xz-utils build-essential | |
git clone https://github.com/asdf-vm/asdf.git "${HOME}/.asdf" | |
env: | | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -exo pipefail | |
set +u | |
. "${HOME}/.asdf/asdf.sh" | |
asdf plugin test nim . \ | |
--asdf-tool-version \ | |
"${{ matrix.nim-version }}" \ | |
--asdf-plugin-gitref \ | |
"${GITHUB_SHA}" \ | |
nim -v |