Skip to content

Commit

Permalink
Merge pull request #90 from Tieqiong/workflow
Browse files Browse the repository at this point in the history
try new workflow ymls
  • Loading branch information
sbillinge authored Aug 19, 2024
2 parents c8a2477 + f660310 commit c41ab2f
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 88 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Gather coverage report and upload to codecov

on:
push:
branches:
- main
release:
types:
- prereleased
- published
workflow_dispatch:

defaults:
run:
shell: bash -l {0}

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Check out diffpy.structure
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no
- name: Install diffpy.structure and requirements
run: |
conda install --file requirements/run.txt
conda install --file requirements/test.txt
python -m pip install -r requirements/pip.txt
python -m pip install . --no-deps
- name: Validate diffpy.structure
run: |
coverage run -m pytest -vv -s
coverage report -m
codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
59 changes: 26 additions & 33 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,47 @@
name: Build Documentation
name: Build and Deploy Documentation

on:
push:
branches:
- main
release:
types:
- prereleased
- published
workflow_dispatch:

defaults:
run:
shell: bash -l {0}

jobs:
test:
docs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check out diffpy.structure
uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false

- name: install requirements
- name: Conda config
run: >-
conda install -n build -c conda-forge
--file requirements/build.txt
--file requirements/run.txt
--file requirements/docs.txt
--quiet --yes
conda config --set always_yes yes
--set changeps1 no
- name: install the package
run: python -m pip install . --no-deps
- name: Install diffpy.structure and build requirements
run: |
conda install --file requirements/build.txt
conda install --file requirements/run.txt
conda install --file requirements/docs.txt
python -m pip install -r requirements/pip.txt
python -m pip install . --no-deps
- name: build documents
run: make -C doc html

- name: Run tests and upload coverage
shell: bash -l {0}
run: |
conda activate test
coverage run -m pytest -vv -s
coverage report -m
codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
Expand Down
55 changes: 0 additions & 55 deletions .github/workflows/main.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Validate using pytest

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

defaults:
run:
shell: bash -l {0}

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Check out diffpy.structure
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no
- name: Install diffpy.structure and requirements
run: |
conda install --file requirements/run.txt
conda install --file requirements/test.txt
python -m pip install -r requirements/pip.txt
python -m pip install . --no-deps
- name: Validate diffpy.structure
run: python -m pytest

0 comments on commit c41ab2f

Please sign in to comment.