Skip to content

Commit

Permalink
add github CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed Mar 4, 2024
1 parent 55e0c52 commit 301eab8
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: impulse CI
on:
push:
paths:
- 'tests/**'
- '**'
- 'impulse.nimble'
- '.github/workflows/ci.yml'
pull_request:
paths:
- 'tests/**'
- '**'
- 'impulse.nimble'
- '.github/workflows/ci.yml'

jobs:
build:
strategy:
fail-fast: false
matrix:
branch: [version-1-6, devel]
target: [linux, macos, windows]
include:
- target: linux
builder: ubuntu-latest
- target: macos
builder: macos-latest
- target: windows
builder: windows-latest
name: '${{ matrix.target }} (${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: impulse

- name: Setup Nim
uses: alaviss/setup-nim@0.1.1
with:
path: nim
version: ${{ matrix.branch }}

- name: Setup nimble & deps
shell: bash
run: |
cd impulse
nimble refresh -y
nimble install -y
- name: Run tests
shell: bash
run: |
cd impulse
nimble -y test
- name: Build docs
if: >
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
matrix.target == 'linux' && matrix.branch == 'devel'
shell: bash
run: |
cd impulse
branch=${{ github.ref }}
branch=${branch##*/}
nimble doc --project --outdir:docs \
'--git.url:https://github.com/${{ github.repository }}' \
'--git.commit:${{ github.sha }}' \
"--git.devel:$branch" \
impulse.nim
# Ignore failures for older Nim
cp docs/{the,}index.html || true
- name: Publish docs
if: >
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
matrix.target == 'linux' && matrix.branch == 'devel'
uses: crazy-max/ghaction-github-pages@v1
with:
build_dir: impulse/docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 301eab8

Please sign in to comment.