forked from jonathan-taylor/ISLP
-
Notifications
You must be signed in to change notification settings - Fork 78
104 lines (90 loc) · 2.92 KB
/
Copy pathbuild_notebook_errors.yml
File metadata and controls
104 lines (90 loc) · 2.92 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
# This is a basic workflow to help you get started with Actions
name: Build a notebook (allow errors, capture result)
# Controls when the workflow will run
on:
workflow_dispatch:
inputs:
LABS:
description: 'Labs version'
required: true
default: 'v2'
type: string
ID:
description: 'Which lab to build'
required: true
default: '02'
type: string
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-linux:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
# Install
- name: Install dependencies
run: |
pip install .
# Runs a set of commands using the runners shell
- name: Build notebook, allowing errors
env:
LABS: ${{ inputs.LABS }}
ID: ${{ inputs.ID }}
run: |
git clone https://github.com/intro-stat-learning/ISLP_labs.git
cd ISLP_labs
git checkout $LABS
cp Ch*$ID*lab.ipynb ..
jupyter nbconvert --execute --inplace ../Ch*$ID*lab.ipynb --allow-errors
jupyter nbconvert --to html ../Ch*$ID*lab.ipynb
# Store the output
- name: Upload labs
env:
ID: ${{ inputs.ID }}
uses: actions/upload-artifact@v3
with:
name: ISLP_labs
path: Ch*
retention-days: 1
build-mac:
# The type of runner that the job will run on
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
# Install
- name: Install dependencies
run: |
pip install .
# Runs a set of commands using the runners shell
- name: Build notebook, allowing errors
env:
LABS: ${{ inputs.LABS }}
ID: ${{ inputs.ID }}
run: |
git clone https://github.com/intro-stat-learning/ISLP_labs.git
cd ISLP_labs
git checkout $LABS
cp Ch*$ID*lab.ipynb ..
jupyter nbconvert --execute --inplace ../Ch*$ID*lab.ipynb --allow-errors
jupyter nbconvert --to html ../Ch*$ID*lab.ipynb
# Store the output
- name: Upload labs
env:
ID: ${{ inputs.ID }}
uses: actions/upload-artifact@v3
with:
name: ISLP_labs
path: Ch*
retention-days: 1