From 6d1f3bd55042cf48ede5a41322ae28cd13a5040d Mon Sep 17 00:00:00 2001 From: ee7 <45465154+ee7@users.noreply.github.com> Date: Fri, 10 May 2024 15:58:45 +0200 Subject: [PATCH] ci: add tests workflow (#120) For now, the tests fail. At least the `nimble build` step of the new workflow succeeds in CI - it didn't on Linux until the previous commit [1]. Add only Linux x86_64 for now. On macOS x86_64, the workflow would error with: clang: error: no such file or directory: '/Users/runner/.local/c0/libs/libffi.a' and on macOS arm64 it would error with: ERROR: unable to find archive matching pattern macosx_arm64.tar.xz because the Nim nightlies repo doesn't have a binary build for that platform yet. [1] 2024-04-08, 5e7a21cad233, "fix: make nimble build succeed on Linux" --- .github/workflows/tests.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..6552b08c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,46 @@ +name: tests + +on: + push: + branches: + - dev + - jtv/v2 + - main + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + tests: + strategy: + fail-fast: false + matrix: + include: + - os: linux + runs-on: ubuntu-22.04 + arch: x86_64 + + name: "${{ matrix.os }}-${{ matrix.arch }}" + runs-on: ${{ matrix.runs-on }} + + steps: + - name: Checkout + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # 4.1.4 + + - name: Install Nim + uses: iffy/install-nim@c76b9157e544576bf61c932ee66ff3c7d194deb9 # 5.0.4 + with: + version: "binary:2.0.0" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Avoid rate limiting. + + - name: Install Nimble dependencies + run: nimble --accept install --depsOnly + + - name: Build + run: nimble build + + - name: Run tests + run: ./test