-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from Tieqiong/workflow
use latest workflow
- Loading branch information
Showing
5 changed files
with
147 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out diffpy.pdffit2 | ||
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.pdffit2 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.pdffit2 | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,48 @@ | ||
name: Build Documentation | ||
name: Build and Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- cookie # to be removed during merge to main | ||
release: | ||
types: | ||
- 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.pdffit2 | ||
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.pdffit2 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: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./doc/build/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,42 @@ | ||
name: CI | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- CI | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
miniconda: | ||
name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ['3.10', '3.11', '3.12'] | ||
os: ["macos-latest", "ubuntu-latest", "windows-latest"] | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check out diffpy.pdffit2 | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: diffpy/diffpy.pdffit2 | ||
path: . | ||
fetch-depth: 0 # avoid shallow clone with no tags | ||
- name: Check out diffpy.pdffit2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: initialize miniconda | ||
# this uses a marketplace action that sets up miniconda in a way that makes | ||
# it easier to use. I tried setting it up without this and it was a pain | ||
- name: Initialize miniconda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniconda-version: "latest" | ||
activate-environment: test | ||
# environment.yml file is needed by this action. Because I don't want | ||
# maintain this but rather maintain the requirements files it just has | ||
# basic things in it like conda and pip | ||
auto-update-conda: true | ||
environment-file: environment.yml | ||
python-version: ${{ matrix.python-version }} | ||
auto-activate-base: false | ||
|
||
- name: install diffpy.pdffit2 requirements | ||
shell: bash -l {0} | ||
- name: Conda config | ||
run: >- | ||
conda config --set always_yes yes | ||
--set changeps1 no | ||
- name: Install diffpy.pdffit2 and requirements | ||
run: | | ||
conda config --set always_yes yes --set changeps1 no | ||
conda config --add channels conda-forge | ||
conda activate test | ||
conda install --file requirements/build.txt | ||
conda install --file requirements/run.txt | ||
conda install --file requirements/test.txt | ||
pip install . | ||
- name: Validate diffpy.pdffit2 | ||
shell: bash -l {0} | ||
run: | | ||
conda activate test | ||
coverage run src/diffpy/pdffit2/tests/run.py | ||
coverage report -m | ||
codecov | ||
python -m pip install -r requirements/pip.txt | ||
python -m pip install . --no-deps | ||
# Use this after migrating to pytest | ||
# - name: Validate diffpy.pdffit2 | ||
# shell: bash -l {0} | ||
# run: | | ||
# conda activate test | ||
# coverage run -m pytest -vv -s | ||
# coverage report -m | ||
# codecov | ||
- name: Validate diffpy.pdffit2 | ||
run: python -m pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Matrix test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
test: | ||
name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ['3.10', '3.11', '3.12'] | ||
os: ["macos-latest", "ubuntu-latest", "windows-latest"] | ||
steps: | ||
- name: check out diffpy.pdffit2 | ||
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 | ||
python-version: ${{ matrix.python-version }} | ||
auto-activate-base: false | ||
|
||
- name: Conda config | ||
run: >- | ||
conda config --set always_yes yes | ||
--set changeps1 no | ||
- name: Install diffpy.pdffit2 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.pdffit2 | ||
run: python -m pytest |
This file was deleted.
Oops, something went wrong.