-
Notifications
You must be signed in to change notification settings - Fork 10
91 lines (78 loc) · 2.52 KB
/
test.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
name: CI
on: [push, pull_request]
jobs:
render:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: python -m pip install cookiecutter
- run: python -m cookiecutter . --no-input
- uses: actions/upload-artifact@v4
with:
name: rendered-project
path: wagtail-llama-save
lint:
needs: render
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/download-artifact@v4
# Restore the rendered artifact to a directory outside the repo checkout.
# Even if we invoke pre-commit from in a subdirectory
# it tries to lint the whole repo including the raw templates.
with:
name: rendered-project
path: /tmp/wagtail-llama-save
- name: Run Lint Checks
working-directory: /tmp/wagtail-llama-save
# In order to get pre-commit to see any files,
# we have to initialize a git repo
# and at least stage the files we want to check.
# Otherwise pre-commit will stash everything and
# tell us there are no files to check.
# refs
# https://github.com/wagtail/cookiecutter-wagtail-package/pull/45#discussion_r1064195179
# https://github.com/pre-commit/pre-commit/issues/848
run: |
git init
git add .
python -m pip install pre-commit
pre-commit run --all-files --show-diff-on-failure --color=always
install-package:
needs: render
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/download-artifact@v4
with:
name: rendered-project
path: wagtail-llama-save
- name: Ensure package can be installed
working-directory: wagtail-llama-save
run: python -m pip install -e .
build-js:
needs: render
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- uses: actions/download-artifact@v4
with:
name: rendered-project
path: wagtail-llama-save
- name: Build JS
working-directory: wagtail-llama-save
run: |
npm install --omit=optional --no-audit --progress=false
npm run build