Skip to content

Commit

Permalink
gh-actions: seperate pipelines better
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Feb 10, 2023
1 parent 05cfa0d commit d3296c3
Showing 1 changed file with 45 additions and 15 deletions.
60 changes: 45 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,19 @@ jobs:
testenv: 'lint'
- python-version: '3.10'
testenv: 'build-doc'
- python-version: '3.10'
testenv: 'valgrind'
steps:
- uses: actions/checkout@main
with:
ref: ${{ github.event.inputs.ref }}
submodules: true
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Fetch apt-get packets
if: matrix.testenv == 'valgrind' || matrix.testenv == 'build-doc'
run: sudo apt-get update
- name: Install valgrind
if: matrix.testenv == 'valgrind'
run: sudo apt-get install valgrind
- name: Install libclang
if: matrix.testenv == 'build-doc'
run: |
sudo apt-get update
sudo apt-get install libclang1-14
# hack to get sphinx-c-autodoc to build C API documentation
sudo ln -s /usr/lib/llvm-14/lib/libclang-14.so.1 /usr/lib/libclang-14.so
Expand All @@ -77,11 +66,52 @@ jobs:
if: matrix.testenv == 'test'
with:
flags: ${{ matrix.python-version }}
- name: Upload doc
- name: Upload docs
if: matrix.testenv == 'build-doc'
uses: actions/upload-artifact@main
with:
name: docs
path: docs/_build/html
valgrind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
ref: ${{ github.event.inputs.ref }}
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install valgrind
python -m pip install --upgrade pip
python -m pip install tox
- name: Test with tox
run: |
tox -e valgrind
deploy-doc:
runs-on: ubuntu-latest
needs: tox
if: >-
github.event_name == 'push' &&
(startsWith(github.event.ref, 'refs/tags') || github.event.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@main
with:
ref: gh_pages
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- uses: actions/download-artifact@main
with:
name: docs
path: docs/_build/html
- name: Deploy doc
run: |
git fetch origin gh_pages
git checkout gh_pages
cp -r docs/_build/html/* docs/
rm -rf docs/_build
git add docs/
Expand Down

0 comments on commit d3296c3

Please sign in to comment.