-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (73 loc) · 2.6 KB
/
service-notebook.yaml
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
name: Notebook service CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
lint-git:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Checkout on HEAD commit of the current pull request HEAD.
# As this job is triggered on pull request event, the checkout is by
# default on the merge commit.
ref: ${{ github.event.pull_request.head.sha }}
# By default, `fetch-depth` is set to 1, meaning it would only
# consider the last commit. Set to 0 will fetch the entire history
# of the branch commits.
fetch-depth: 0
# - name: Fetch latest changes
# run: git fetch origin main
# - name: Get commit hash of origin/main
# id: get_origin_main_hash
# run: echo "::set-output name=hash::$(git rev-parse origin/main)"
- name: Enforce absence of print statements in code
run: |
! git diff origin/main..HEAD -- . ':(exclude).github' | grep "print("
- name: Enforce absence of FIXME statements in code
run: |
! git diff origin/main..HEAD -- . ':(exclude).github' | grep "FIXME"
- name: Check absence of fixup commits
run: |
! git log --pretty=format:%s | grep 'fixup!'
- name: Install gitlint
run: |
pip install --user gitlint requests
- name: Lint commit messages added to main
run: |
~/.local/bin/gitlint --commits origin/main..HEAD
build-docker-notebook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build wendy notebook image
run: make build
- name: Check built image availability
run: docker images "wendy-notebook:latest"
- name: Export Docker image
run: >
mkdir artifacts &&
docker save wendy-notebook:latest > artifacts/wendy-notebook.tar
- name: Save Docker image artifact
uses: actions/upload-artifact@v4
with:
name: docker-wendy-notebook
path: artifacts
retention-days: 1
compression-level: 0
lint:
needs: build-docker-notebook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve saved Docker image
uses: actions/download-artifact@v4
with:
name: docker-wendy-notebook
path: artifacts
- name: Load Docker image
run: docker load -i artifacts/wendy-notebook.tar
- name: Lint notebook with nbqa
run: make lint