Merge pull request #35 from amq92/slurm-test #74
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: Run Python Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- "8888:3306" | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up SLURM | |
uses: koesterlab/setup-slurm-action@v1 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Copy files to SLURM node | |
run: | | |
mkdir -p $HOME/slurm_workspace | |
rsync -av --progress . $HOME/slurm_workspace/ | |
ls -lah $HOME/slurm_workspace # Debugging step | |
- name: Run tests with unittest | |
run: | | |
cd $HOME/slurm_workspace | |
python -m unittest -v |