Updated syntax for easier initialization #186
Workflow file for this run
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: Unit Tests | |
on: | |
push: | |
pull_request: | |
# schedule: | |
# - cron: '00 4 * * *' # daily at 4AM | |
jobs: | |
run_tests: | |
runs-on: ${{ matrix.host-os }} | |
strategy: | |
matrix: | |
host-os: ["ubuntu-latest"] | |
python-version: ["3.8", "3.9", "3.10"] | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Set env vars | |
run: | | |
export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} # just the repo, as opposed to org/repo | |
echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Start MongoDB | |
uses: supercharge/[email protected] | |
- name: Start Sirepo Docker container | |
uses: NSLS-II/start-sirepo-action@v1 | |
with: | |
docker-binary: docker | |
- name: Copy databroker config file | |
run: | | |
set -vxeuo pipefail | |
mkdir -v -p ~/.config/databroker/ | |
wget https://raw.githubusercontent.com/NSLS-II/sirepo-bluesky/main/examples/local.yml -O ~/.config/databroker/local.yml | |
- name: Set up Python ${{ matrix.python-version }} with conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} | |
auto-update-conda: true | |
miniconda-version: "latest" | |
python-version: ${{ matrix.python-version }} | |
mamba-version: "*" | |
channels: conda-forge | |
- name: Install dependencies | |
run: | | |
# For reference: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html. | |
set -vxeo pipefail | |
conda env list | |
mamba install -c conda-forge shadow3 srwpy | |
pip install --upgrade pip wheel | |
pip install -v . | |
pip install -r requirements-dev.txt | |
pip list | |
conda list | |
- name: Test with pytest | |
run: | | |
set -vxeuo pipefail | |
coverage run -m pytest -vv -s | |
coverage report -m |