test for flux #17
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: Flux | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Start Docker container | |
run: | | |
docker run -itd --name flux -v `pwd`:/pydra fluxrm/flux-sched:focal-v0.28.0 flux start | |
sleep 5 # Give the container some time to start | |
- name: Run necessary changes in container | |
run: | | |
# Install Python 3 (if not already installed) | |
docker exec flux apt-get update | |
docker exec flux apt-get install -y python3 | |
# Add Python to PATH | |
docker exec flux echo 'export PATH="/home/fluxuser/.local/bin:$PATH"' >> ~/.bashrc | |
# Create an alias for 'python' (pointing to 'python3') | |
docker exec flux echo 'alias python=python3' >> ~/.bashrc | |
# Source the updated .bashrc to apply changes | |
docker exec flux source ~/.bashrc | |
- name: Run pytest | |
run: | | |
docker exec flux bash -c "pytest --psij=flux --color=yes -vs -n auto --psij=slurm --cov pydra --cov-config /pydra/.coveragerc --cov-report xml:/pydra/cov.xml --doctest-modules /pydra/pydra/" | |
- name: Upload to codecov | |
run: | | |
docker exec flux bash -c "codecov --root /pydra -f /pydra/cov.xml -F unittests" | |
- name: Stop and remove Docker container | |
run: docker stop flux && docker rm flux |