|
# Nimcheck CI pipeline
|
|
# Runs lint, test, and build on push and pull request.
|
|
#
|
|
# Requires a Gitea act_runner with the "ubuntu-latest" label
|
|
# (default label on the official gitea/act_runner image).
|
|
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
NIM_VERSION: "2.0.0"
|
|
|
|
jobs:
|
|
# ------------------------------------------------------------------
|
|
# Lint: compile with full hints and warnings enabled
|
|
# ------------------------------------------------------------------
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Nim
|
|
run: |
|
|
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y "stable"
|
|
echo "$HOME/.nimble/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Lint
|
|
run: make lint
|
|
|
|
# ------------------------------------------------------------------
|
|
# Test: compile and run the full test suite
|
|
# ------------------------------------------------------------------
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Nim
|
|
run: |
|
|
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y "stable"
|
|
echo "$HOME/.nimble/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Run tests
|
|
run: make test
|
|
|
|
# ------------------------------------------------------------------
|
|
# Build: produce the release binary (runs only after lint + test)
|
|
# ------------------------------------------------------------------
|
|
build:
|
|
name: Build
|
|
needs: [lint, test]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Nim
|
|
run: |
|
|
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y "stable"
|
|
echo "$HOME/.nimble/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Build
|
|
run: make build
|