Skip to content

Commit 224b4d4

Browse files
committed
ci upgrades
1 parent 106e072 commit 224b4d4

File tree

6 files changed

+106
-100
lines changed

6 files changed

+106
-100
lines changed

.gitattributes

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@
22
.gitattributes export-ignore
33

44
# Files & folders that should not be included in production.
5-
/.github/ export-ignore
6-
/docs/src/markdown/_snippets/ export-ignore
7-
/docs/src/markdown/about/ export-ignore
8-
/docs/src/markdown/index.md export-ignore
9-
/docs/src/markdown/installation.md export-ignore
10-
/docs/src/markdown/usage.md export-ignore
11-
/docs/src/requirements.txt export-ignore
12-
/tests/ export-ignore
13-
/.pyspelling.yml export-ignore
14-
/.travis.yml export-ignore
15-
/mkdocs.yml export-ignore
16-
/Pipfile export-ignore
17-
/run_tests.sh export-ignore
18-
/setup.cfg export-ignore
19-
/tox.ini export-ignore
5+
/.github/ export-ignore
6+
/.prospector.yml export-ignore
7+
/.pyspelling.yml export-ignore
8+
/.python-version export-ignore
9+
/docs/ export-ignore
10+
/mkdocs.yml export-ignore
11+
/run_tests.sh export-ignore
12+
/tests/ export-ignore
13+
/tox.ini export-ignore

.github/workflows/build.yml

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,71 @@
1-
name: build
1+
name: Build
22

33
on:
44
push:
55
branches:
66
- 'master'
77
tags:
8-
- '**'
8+
- '**'
99
pull_request:
1010
branches:
11-
- '**'
11+
- '**'
1212

1313
jobs:
1414
tests:
15-
16-
env:
17-
TOXENV: py311
18-
1915
runs-on: ubuntu-latest
2016

2117
steps:
22-
- uses: actions/checkout@v4
23-
- name: Set up Python
24-
uses: actions/setup-python@v4
25-
with:
26-
python-version: 3.11
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip setuptools tox build
30-
- name: Tests
31-
run: |
32-
python -m tox
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
3320

34-
lint:
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version-file: '.python-version'
3525

36-
env:
37-
TOXENV: lint
26+
- name: Install dependencies
27+
run: python -m pip install --upgrade pip setuptools tox
3828

29+
- name: Run tests
30+
run: python -m tox -e py
31+
32+
lint:
3933
runs-on: ubuntu-latest
4034

4135
steps:
42-
- uses: actions/checkout@v4
43-
- name: Set up Python
44-
uses: actions/setup-python@v4
45-
with:
46-
python-version: 3.11
47-
- name: Install dependencies
48-
run: |
49-
python -m pip install --upgrade pip setuptools tox build
50-
- name: Lint
51-
run: |
52-
python -m tox
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
5338

54-
documents:
39+
- name: Set up Python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version-file: '.python-version'
5543

56-
env:
57-
TOXENV: documents
44+
- name: Install dependencies
45+
run: python -m pip install --upgrade pip setuptools tox
5846

47+
- name: Run linter
48+
run: python -m tox -e lint
49+
50+
documents:
5951
runs-on: ubuntu-latest
6052

6153
steps:
62-
- uses: actions/checkout@v4
63-
- name: Set up Python
64-
uses: actions/setup-python@v4
65-
with:
66-
python-version: 3.11
67-
- name: Install dependencies
68-
run: |
69-
python -m pip install --upgrade pip setuptools tox build
70-
- name: Install Aspell
71-
run: |
72-
sudo apt-get install aspell aspell-en
73-
- name: Build documents
74-
run: |
75-
python -m tox
54+
- name: Checkout repository
55+
uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0
58+
59+
- name: Install system dependencies
60+
run: sudo apt-get install -y aspell aspell-en
61+
62+
- name: Set up Python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version-file: '.python-version'
66+
67+
- name: Install dependencies
68+
run: python -m pip install --upgrade pip setuptools tox
69+
70+
- name: Build documents
71+
run: python -m tox -e documents

.github/workflows/deploy.yml

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,50 @@
1-
name: deploy
1+
name: Documentation
22

33
on:
44
push:
55
tags:
6-
- '*'
6+
- '*'
7+
workflow_dispatch:
78

8-
jobs:
9+
permissions:
10+
contents: read
11+
id-token: write
12+
pages: write
913

10-
documents:
14+
concurrency:
15+
group: docs-${{ github.ref }}
16+
cancel-in-progress: true
1117

18+
jobs:
19+
build:
1220
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version-file: '.python-version'
1331

32+
- name: Install dependencies
33+
run: pip install -r docs/src/requirements.txt
34+
35+
- name: Build documentation
36+
run: mkdocs build --clean --verbose --strict
37+
38+
- name: Upload static files as artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: site/
42+
43+
deploy:
44+
needs: build
45+
runs-on: ubuntu-latest
46+
environment:
47+
name: github-pages
1448
steps:
15-
- uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
- name: Set up Python
19-
uses: actions/setup-python@v4
20-
with:
21-
python-version: 3.11
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip setuptools build
25-
python -m pip install -r docs/src/requirements.txt
26-
- name: Deploy documents
27-
run: |
28-
git config user.name "${{ github.actor }}"
29-
git config user.email "${{ secrets.GH_EMAIL }}"
30-
git remote add gh-token "https://${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git"
31-
git fetch gh-token && git fetch gh-token gh-pages:gh-pages
32-
python -m mkdocs gh-deploy -v --clean --remote-name gh-token
33-
git push gh-token gh-pages
49+
- name: Deploy to GitHub Pages
50+
uses: actions/deploy-pages@v4

docs/theme/announce.html

Whitespace-only changes.

mkdocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ copyright: |
99
docs_dir: docs/src/markdown
1010
theme:
1111
name: material
12-
custom_dir: docs/theme
1312
icon:
1413
logo: material/book-open-page-variant
1514
palette:

tox.ini

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
[tox]
22
isolated_build = true
3-
skipsdist=True
3+
skipsdist = true
44
envlist =
5-
py37,py38,py39,py310,py311,lint
5+
py,lint
66

77
[testenv]
8-
deps=
8+
deps =
99
pytest
10-
commands=
11-
py.test .
10+
commands =
11+
pytest .
1212

1313
[testenv:documents]
14-
deps=
14+
deps =
1515
-rdocs/src/requirements.txt
16-
commands=
16+
commands =
1717
"{envpython}" -m mkdocs build --clean --verbose --strict
1818
pyspelling
1919

2020
[testenv:lint]
21-
deps=
21+
deps =
2222
flake8
2323
flake8_docstrings
2424
pep8-naming
2525
flake8-mutable
2626
flake8-builtins
27-
commands=
27+
commands =
2828
flake8 "{toxinidir}"
2929

3030
[flake8]
31-
ignore=D202,D203,D401,W504,E741,N818,A005
32-
max-line-length=140
33-
exclude=site/*.py,.tox/*,lib/coloraide/*,lib/coloraide_extras
31+
ignore = D202,D203,D401,W504,E741,N818,A005
32+
max-line-length = 140
33+
exclude = site/*.py,.tox/*,lib/coloraide/*,lib/coloraide_extras

0 commit comments

Comments
 (0)