-
Notifications
You must be signed in to change notification settings - Fork 16
129 lines (118 loc) · 3.66 KB
/
ci.yml
File metadata and controls
129 lines (118 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: ggplotnim CI
on:
push:
paths:
- 'tests/**'
- 'src/**'
- 'ggplotnim.nimble'
- '.github/workflows/ci.yml'
branches:
- 'master'
pull_request:
paths:
- 'tests/**'
- 'src/**'
- 'ggplotnim.nimble'
- '.github/workflows/ci.yml'
jobs:
build:
strategy:
fail-fast: false
matrix:
nim: ['2.2.x', 'devel']
target: [linux, macos, windows]
include:
- target: linux
builder: ubuntu-latest
- target: macos
builder: macos-latest
- target: windows
builder: windows-latest
exclude:
- target: windows
nim: devel
name: '${{ matrix.target }} (${{ matrix.nim }})'
runs-on: ${{ matrix.builder }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ggplotnim
- name: Setup Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: ${{ matrix.nim }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
use-nightlies: ${{ matrix.nim == 'devel' }}
- name: Install dependencies (Ubuntu)
if: ${{matrix.target == 'linux'}}
run: |
sudo apt-get update
sudo apt-get install libcairo2 libcairo2-dev imagemagick \
libgtk-3-dev webkit2gtk-driver \
liblapack3 liblapack-dev libblas3 libblas-dev \
libwebkit2gtk-4.1-0 libwebkit2gtk-4.1-dev
- name: Install dependencies (OSX)
if: ${{matrix.target == 'macos'}}
run: |
brew install imagemagick cairo
- 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-cairo
pacman -S --needed --noconfirm mingw-w64-x86_64-lapack
- name: Setup nimble & deps
shell: bash
run: |
# limit our stack size to avoid regressing after PR #36 w/o noticing
ulimit -s 1024
cd ggplotnim
nimble refresh -y
nimble install ntangle -y
nimble install -y
- name: Run tests (Linux & Mac)
if: ${{matrix.target != 'windows'}}
shell: bash
run: |
cd ggplotnim
nimble -y fullTest
nimble -y testCI
- name: Run tests (Windows)
if: ${{matrix.target == 'windows'}}
shell: msys2 {0}
run: |
cd ggplotnim
nimble -y fullTest
nimble -y testCI
- name: Build docs
if: >
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
matrix.target == 'linux' && matrix.nim == 'devel'
shell: bash
run: |
cd ggplotnim
# **HAVE** to call `develop`, cuz we're getting screwed by
# logic otherwise
nimble develop -y
nimble gen_docs
# TODO: fix this, need to iterate over all files, do similar to arraymancer docs
# 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.nim == 'devel'
uses: crazy-max/ghaction-github-pages@v1
with:
build_dir: ggplotnim/docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}