-
Notifications
You must be signed in to change notification settings - Fork 15
119 lines (108 loc) · 3.21 KB
/
ci.yml
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
name: plotly CI
on:
push:
paths:
- 'tests/**'
- 'src/**'
- 'plotly.nimble'
- '.github/workflows/ci.yml'
pull_request:
paths:
- 'tests/**'
- 'src/**'
- 'plotly.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: plotly
- 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 libgtk-3-dev libwebkit2gtk-4.0-dev \
at-spi2-core firefox
- name: Install dependencies (OSX)
if: ${{matrix.target == 'macos'}}
run: |
brew install firefox
- 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-qtwebkit
- name: Setup nimble & deps
shell: bash
run: |
cd plotly
nimble refresh -y
nimble install -y
- name: Run tests (Linux & Mac)
if: ${{matrix.target != 'windows'}}
shell: bash
run: |
cd plotly
export BROWSER=firefox
nimble -y testCINoSave
- name: Run tests (Windows)
if: ${{matrix.target == 'windows'}}
shell: msys2 {0}
run: |
cd plotly
export BROWSER=firefox
nimble -y testCINoSave
- name: Build docs
if: >
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
matrix.target == 'linux' && matrix.branch == 'devel'
shell: bash
run: |
cd plotly
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/plotly.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: plotly/docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}