-
Notifications
You must be signed in to change notification settings - Fork 9
158 lines (129 loc) · 4.09 KB
/
pages.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# SPDX-FileCopyrightText: 2024 Margo
#
# SPDX-License-Identifier: MIT
#
# Author: Christian Storm <[email protected]>
# Author: Silvano Cirujano Cuesta <[email protected]>
---
name: GitHub Pages
on: [push, pull_request, workflow_dispatch]
permissions:
contents: write
jobs:
quality-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install poetry
run: pipx install poetry
- name: Check pyproject.toml and poetry.lock
run: poetry check
validate:
needs:
- quality-checks
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure tags if not run from main repo
if: github.repository != 'margo/specification'
run: |
git remote add upstream https://github.com/margo/specification
git fetch upstream --tags
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.12'
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: Run tests
run: |
doc-generation/check-examples.bash
documents:
needs:
- quality-checks
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure tags if not run from main repo
if: github.repository != 'margo/specification'
run: |
git remote add upstream https://github.com/margo/specification
git fetch upstream --tags
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.12'
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: Generate MarkDown documentation
run: |
doc-generation/generate-documentation.bash
- name: Share generated documentation with later jobs
uses: actions/upload-artifact@v4
with:
name: generated-documentation
path: |
system-design/app-interoperability/application-package-definition.md
system-design/margo-api-reference/workload-api/desired-state-api/desired-state.md
pages:
needs:
- validate
- documents
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install poetry
uses: abatilo/actions-poetry@v2
# create local virtualenv to enable caching in CI
- name: Configure poetry
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Setup Cache
uses: actions/cache@v4
with:
path: ./.venv
# cache is invalidated if dependencies change
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Get generated documentation from previous jobs
uses: actions/download-artifact@v4
with:
name: generated-documentation
path: system-design/
- name: Build Pages
run: poetry run -- mkdocs build
- name: GitHub Pages Deploy
# only deploy if we are on the default branch
if: ${{ github.ref == 'refs/heads/pre-draft' }}
run: poetry run -- mkdocs gh-deploy --force --clean --verbose
- name: Upload pages
uses: actions/upload-artifact@v4
if: ${{ github.ref != 'refs/heads/pre-draft' }}
with:
name: margo-specification
path: site
retention-days: 5