-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
261 additions
and
13 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,50 @@ | ||
name: Deploy documentation with GitHub Pages dependencies preinstalled | ||
|
||
on: | ||
push: | ||
branches: ["develop"] | ||
workflow_dispatch: # enable manual workflow execution | ||
|
||
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
# prevent this action from running on forks | ||
if: github.repository == 'abinit/abipy' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
|
||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./docs | ||
destination: ./_site | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
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,81 @@ | ||
# Runs the complete test suite. | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
paths-ignore: ["**/*.md", docs/**] | ||
pull_request: | ||
branches: [develop] | ||
paths-ignore: ["**/*.md", docs/**] | ||
workflow_dispatch: | ||
workflow_call: # make this workflow reusable by release.yml | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
# prevent this action from running on forks | ||
if: github.repository == 'abinit/abipy' | ||
defaults: | ||
run: | ||
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# maximize CI coverage of different platforms and python versions while minimizing the | ||
# total number of jobs. We run all pytest splits with the oldest supported python | ||
# version (currently 3.9) on windows (seems most likely to surface errors) and with | ||
# newest version (currently 3.12) on ubuntu (to get complete coverage on unix). | ||
config: | ||
- os: windows-latest | ||
python: "3.9" | ||
resolution: highest | ||
extras: ci,optional | ||
- os: ubuntu-latest | ||
python: '>3.9' | ||
resolution: lowest-direct | ||
extras: ci,optional | ||
- os: macos-latest | ||
python: '3.10' | ||
resolution: lowest-direct | ||
extras: ci # test with only required dependencies installed | ||
|
||
# pytest-split automatically distributes work load so parallel jobs finish in similar time | ||
# update durations file with `pytest --store-durations --durations-path tests/files/.pytest-split-durations` | ||
split: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | ||
|
||
runs-on: ${{ matrix.config.os }} | ||
|
||
#env: | ||
# PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }} | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up micromamba | ||
uses: mamba-org/setup-micromamba@main | ||
|
||
- name: Create mamba environment | ||
run: | | ||
micromamba create -n abipy python=${{ matrix.config.python }} --yes | ||
- name: Install uv | ||
run: micromamba run -n abipy pip install uv | ||
|
||
#- name: Install ubuntu-only conda dependencies | ||
# if: matrix.config.os == 'ubuntu-latest' | ||
# run: | | ||
# micromamba install -n abipy -c conda-forge enumlib packmol bader openbabel openff-toolkit --yes | ||
|
||
- name: Install pymatgen and dependencies | ||
run: | | ||
micromamba activate abipy | ||
uv pip install --editable '.[${{ matrix.config.extras }}]' --resolution=${{ matrix.config.resolution }} | ||
- name: pytest split ${{ matrix.split }} | ||
run: | | ||
micromamba activate abipy | ||
pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests |
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
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
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
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
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