Skip to content

Commit a854135

Browse files
authored
Migrate to Github Actions (#1153)
* Migrate to Github Actions * Pin github actions versions --------- Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
1 parent f417f6e commit a854135

File tree

3 files changed

+121
-100
lines changed

3 files changed

+121
-100
lines changed

.circleci/config.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
flake8_lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
16+
- name: Set up Python
17+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
18+
with:
19+
python-version: '3.9'
20+
- name: Install tox
21+
run: pip install tox
22+
- name: Run flake8
23+
run: tox -e flake8
24+
25+
isort_lint:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
29+
- name: Set up Python
30+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
31+
with:
32+
python-version: '3.9'
33+
- name: Install tox
34+
run: pip install tox
35+
- name: Run isort
36+
run: tox -e isort
37+
38+
mypy_lint:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
42+
- name: Set up Python
43+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
44+
with:
45+
python-version: '3.9'
46+
- name: Install tox
47+
run: pip install tox
48+
- name: Run mypy
49+
run: tox -e mypy
50+
51+
test:
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
56+
steps:
57+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
58+
- name: Set up Python ${{ matrix.python-version }}
59+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
60+
with:
61+
python-version: ${{ matrix.python-version }}
62+
- name: Install dependencies
63+
run: |
64+
pip install --user tox "virtualenv<20.22.0"
65+
echo "$HOME/.local/bin" >> $GITHUB_PATH
66+
- name: Set tox environment
67+
id: toxenv
68+
run: |
69+
VERSION="${{ matrix.python-version }}"
70+
# Extract major.minor version (strip patch if present)
71+
TOX_VERSION=$(echo "$VERSION" | cut -d. -f1,2)
72+
echo "toxenv=py${TOX_VERSION}" >> $GITHUB_OUTPUT
73+
- name: Run tests
74+
run: tox
75+
env:
76+
TOXENV: ${{ steps.toxenv.outputs.toxenv }}
77+
78+
test_nooptionals:
79+
runs-on: ubuntu-latest
80+
env:
81+
PYTHON_VERSION: '3.9'
82+
steps:
83+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
84+
- name: Set up Python
85+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
86+
with:
87+
python-version: ${{ env.PYTHON_VERSION }}
88+
- name: Install tox
89+
run: pip install tox
90+
- name: Run tests without optional dependencies
91+
run: tox
92+
env:
93+
TOXENV: py${{ env.PYTHON_VERSION }}-nooptionals
94+
95+
test_pypy:
96+
runs-on: ubuntu-latest
97+
env:
98+
PYTHON_VERSION: '3.9'
99+
steps:
100+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
101+
- name: Set up PyPy
102+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
103+
with:
104+
python-version: pypy-${{ env.PYTHON_VERSION }}
105+
- name: Install tox
106+
run: pip install tox
107+
- name: Run tests with PyPy
108+
run: tox
109+
env:
110+
TOXENV: pypy${{ env.PYTHON_VERSION }}

.github/workflows/github-pages.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ on:
1111
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1212
permissions:
1313
contents: read
14-
pages: write
15-
id-token: write
16-
actions: read
1714

1815
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1916
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -32,6 +29,9 @@ jobs:
3229
runs-on: ubuntu-latest
3330
env:
3431
HUGO_VERSION: 0.145.0
32+
permissions:
33+
pages: write
34+
id-token: write
3535
steps:
3636
- name: Install Hugo CLI
3737
run: |
@@ -40,13 +40,13 @@ jobs:
4040
#- name: Install Dart Sass
4141
# run: sudo snap install dart-sass
4242
- name: Checkout
43-
uses: actions/checkout@v4
43+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4444
with:
4545
submodules: recursive
4646
fetch-depth: 0
4747
- name: Setup Pages
4848
id: pages
49-
uses: actions/configure-pages@v5
49+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
5050
- name: Install Node.js dependencies
5151
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
5252
working-directory: ./docs
@@ -62,7 +62,7 @@ jobs:
6262
--baseURL "${{ steps.pages.outputs.base_url }}/"
6363
working-directory: ./docs
6464
- name: Upload artifact
65-
uses: actions/upload-pages-artifact@v3
65+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
6666
with:
6767
path: ./docs/public
6868

@@ -73,7 +73,11 @@ jobs:
7373
url: ${{ steps.deployment.outputs.page_url }}
7474
runs-on: ubuntu-latest
7575
needs: build
76+
permissions:
77+
pages: write
78+
id-token: write
79+
actions: read
7680
steps:
7781
- name: Deploy to GitHub Pages
7882
id: deployment
79-
uses: actions/deploy-pages@v4
83+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

0 commit comments

Comments
 (0)