New github workflow new.yml~ #1
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
name: build_and_test_pyaqsapi | ||
run-name: A push event from ${{ github.actor }} caused a rebuilding and retesting of the pyaqsapi package via GitHub actions | ||
on: [push, pull_request, branch] | ||
branches: | ||
- main | ||
- github_workflow | ||
jobs: | ||
setup_environment: | ||
runs-on: ubuntu-latest | ||
env: | ||
AQSkey: ${{ secrets.AQSKEY }} | ||
AQSuser: ${{ secrets.AQSUSER }} | ||
strategy: | ||
max-parallel: 3 | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python >=3.8 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
- name: Add conda to system path | ||
run: | | ||
# $CONDA is an environment variable pointing to the root of the miniconda directory | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Install dependencies | ||
run: | | ||
conda config --add channels conda-forge | ||
conda update --yes conda | ||
conda install --yes conda-libmamba-solver | ||
conda config --set solver libmamba | ||
conda env update --file environment.yml --name setuppyaqsapi | ||
- name: Display Python and sphinx version and system info | ||
run: | | ||
python -c "import platform; print(platform.uname())" | ||
sphinx-build --version | ||
- name: build documentation | ||
run: | | ||
cd docs | ||
make clean | ||
sphinx-apidoc --ext-autodoc -o . ../pyaqsapi/ | ||
make html | ||
#build twice to resolve bibtex references | ||
make html | ||
- name: build and install pyaqsapi in a test environment | ||
run: | | ||
python -m build . | ||
pip install . | ||
- name: Test with pytest | ||
env: | ||
AQSkey: ${{ secrets.AQSKEY }} | ||
AQSuser: ${{ secrets.AQSUSER }} | ||
run: | | ||
pytest |