Skip to content

Commit

Permalink
CI: add steps to upload GHA artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
mrakitin committed Sep 15, 2023
1 parent ab91da5 commit 57b3e35
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: CI-Test
on: [push, pull_request]

jobs:

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]

test:
name: Tests
runs-on: ${{ matrix.host-os }}
Expand All @@ -20,10 +22,10 @@ jobs:
fail-fast: false
steps:
- name: Checkout the code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -32,10 +34,16 @@ jobs:
set -vxeuo pipefail
bash ./scripts/install-deps.sh
- uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl

- name: Test with pytest
run: |
set -vxeuo pipefail
bash ./scripts/run-tests.sh
docs:
name: Documentation
runs-on: ubuntu-latest
Expand All @@ -47,10 +55,10 @@ jobs:

steps:
- name: Checkout the code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -63,3 +71,8 @@ jobs:
run: |
set -vxeuo pipefail
bash ./scripts/build-docs.sh
- uses: actions/upload-artifact@v3
with:
name: ${{ env.REPOSITORY_NAME }}-docs
path: docs/build/html/
5 changes: 5 additions & 0 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
set -vxeuo pipefail
bash ./scripts/build-docs.sh
- uses: actions/upload-artifact@v3
with:
name: ${{ env.REPOSITORY_NAME }}-docs
path: docs/build/html/

- name: Deploy documentation to nsls-ii.github.io
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
Expand Down
10 changes: 4 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-toml
Expand All @@ -10,18 +10,16 @@ repos:
exclude: |
(?x)^(
src/|
docs/|
github_deploy_key_nsls_ii_edrixs.enc
docs/
)
- id: trailing-whitespace
exclude: |
(?x)^(
src/|
docs/|
github_deploy_key_nsls_ii_edrixs.enc
docs/
)
- repo: https://github.com/PyCQA/flake8.git
rev: 4.0.1
rev: 6.1.0
hooks:
- id: flake8
exclude: ^examples/
Expand Down
3 changes: 3 additions & 0 deletions scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ python -m pip install --upgrade pip "setuptools<=65.5.*" numpy
# Install this package and the packages listed in requirements.txt.
pip install -v .

# Generate .whl file.
python setup.py bdist_wheel

# Install extra requirements for running tests and building docs.
pip install -r requirements-dev.txt

Expand Down

0 comments on commit 57b3e35

Please sign in to comment.