Skip to content

Commit fa9f896

Browse files
author
carpenti
committed
adding github actions for CI
1 parent f0b1bdb commit fa9f896

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

.github/workflows/docs.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
- 'README.rst'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- 'docs/**'
14+
- '.github/workflows/docs.yml'
15+
- 'README.rst'
16+
# Allow manual trigger
17+
workflow_dispatch:
18+
19+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
25+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
26+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
27+
concurrency:
28+
group: "pages"
29+
cancel-in-progress: false
30+
31+
jobs:
32+
build:
33+
if: github.ref == 'refs/heads/main'
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: '3.10'
44+
cache: 'pip'
45+
46+
- name: Install dependencies
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install sphinx sphinx-rtd-theme
50+
if [ -f common/docs/requirements.txt ]; then
51+
pip install -r common/docs/requirements.txt
52+
fi
53+
54+
- name: Build documentation
55+
run: make html -C docs
56+
57+
- name: Configure Pages
58+
uses: actions/configure-pages@v5
59+
60+
- name: Upload Pages Artifact
61+
uses: actions/upload-pages-artifact@v3
62+
with:
63+
path: ./docs/_build/html
64+
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

.github/workflows/tests.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Python Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
16+
# Note: Python 3.3 and 3.4 are EOL and not available in GitHub Actions
17+
# Added newer Python versions (3.7-3.10) as replacements
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install coveralls pytest pytest-cov
31+
pip install -e .
32+
33+
- name: Test with pytest and coverage
34+
run: |
35+
pytest --cov=ascii_graph tests/
36+
37+
- name: Upload coverage to Coveralls
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
41+
COVERALLS_PARALLEL: true
42+
uses: coverallsapp/github-action@v2
43+
44+
coveralls-finish:
45+
needs: test
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Coveralls Finished
49+
uses: coverallsapp/github-action@v2
50+
with:
51+
parallel-finished: true

0 commit comments

Comments
 (0)