Add install.sh #11
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
# Based on https://github.com/executablebooks/cookiecutter-jupyter-book/blob/main/.github/workflows/tests.yml | |
name: tests | |
on: | |
# Trigger the workflow on push or pull request on main branch | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
#schedule: | |
# # Run cron job every month, https://crontab.guru/every-month | |
# - cron: '0 0 1 * *' | |
#workflow_dispatch: | |
jobs: | |
# This job tests that the CC works | |
test-and-jb-build: | |
# 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: | |
config: | |
- os: ubuntu-latest | |
python: '3.11' | |
runs-on: ${{ matrix.config.os }} | |
#env: | |
# PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }} | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Check out Abipy-book repo | |
uses: actions/checkout@v4 | |
- name: Set up Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
- name: Installing abinit from conda-forge and abipy with python=${{ matrix.config.python }} | |
run: | | |
conda create -n abipy python=${{ matrix.config.python }} --yes | |
conda activate abipy | |
conda install abinit -c conda-forge --yes | |
mpirun -n 1 abinit --version | |
mpirun -n 1 abinit --build | |
install.sh | |
mkdir -p $HOME/.abinit/abipy/ | |
cp abipy_book/data/gh_manager.yml $HOME/.abinit/abipy/manager.yml | |
cp abipy_book/data/gh_scheduler.yml $HOME/.abinit/abipy/scheduler.yml | |
- name: Build book | |
run: | | |
conda activate abipy | |
jupyter-book build abipy_book --builder linkcheck | |
- name: Upload the book's HTML as an artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: abipy_book/abipy_book/_build/html | |
# Deploy the book's HTML to GitHub Pages | |
#- name: Deploy to GitHub Pages | |
# id: deployment | |
# uses: actions/deploy-pages@v2 |