-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: scinim CI | ||
on: | ||
push: | ||
paths: | ||
- 'tests/**' | ||
- 'src/**' | ||
- 'scinim.nimble' | ||
- '.github/workflows/ci.yml' | ||
pull_request: | ||
paths: | ||
- 'tests/**' | ||
- 'src/**' | ||
- 'scinim.nimble' | ||
- '.github/workflows/ci.yml' | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
branch: [version-1-4, devel] | ||
target: [linux, macos, windows] | ||
include: | ||
- target: linux | ||
builder: ubuntu-18.04 | ||
- target: macos | ||
builder: macos-10.15 | ||
- target: windows | ||
builder: windows-2019 | ||
name: '${{ matrix.target }} (${{ matrix.branch }})' | ||
runs-on: ${{ matrix.builder }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: scinim | ||
|
||
- name: Setup Nim | ||
uses: alaviss/[email protected] | ||
with: | ||
path: nim | ||
version: ${{ matrix.branch }} | ||
|
||
- name: Install dependencies (Ubuntu) | ||
if: ${{matrix.target == 'linux'}} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y python-numpy python3-numpy | ||
- name: Install dependencies (OSX) | ||
if: ${{matrix.target == 'macos'}} | ||
run: | | ||
brew install numpy | ||
- name: Setup MSYS2 (Windows) | ||
if: ${{matrix.target == 'windows'}} | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
path-type: inherit | ||
update: true | ||
install: base-devel git mingw-w64-x86_64-toolchain | ||
|
||
- name: Install dependencies (Windows) | ||
if: ${{matrix.target == 'windows'}} | ||
shell: msys2 {0} | ||
run: | | ||
pacman -Syu --noconfirm | ||
pacman -S --needed --noconfirm mingw-w64-x86_64-python-numpy | ||
- name: Setup nimble & deps | ||
shell: bash | ||
run: | | ||
cd scinim | ||
nimble refresh -y | ||
nimble install -y | ||
- name: Run tests (Linux & Mac) | ||
if: ${{matrix.target != 'windows'}} | ||
shell: bash | ||
run: | | ||
cd scinim | ||
nimble test | ||
- name: Run tests (Windows) | ||
if: ${{matrix.target == 'windows'}} | ||
shell: msys2 {0} | ||
run: | | ||
cd scinim | ||
nimble test | ||
- name: Build docs | ||
if: > | ||
github.event_name == 'push' && github.ref == 'refs/heads/master' && | ||
matrix.target == 'linux' && matrix.branch == 'devel' | ||
shell: bash | ||
run: | | ||
cd scinim | ||
branch=${{ github.ref }} | ||
branch=${branch##*/} | ||
nimble doc --project --path="." --outdir:docs \ | ||
'--git.url:https://github.com/${{ github.repository }}' \ | ||
'--git.commit:${{ github.sha }}' \ | ||
"--git.devel:$branch" \ | ||
src/scinim.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: scinim/docs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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