switch to astral's setup uv command #686
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: Test | |
on: [push, pull_request] | |
jobs: | |
# Run CLI test and pytest | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
resolution: ["highest", "lowest-direct"] | |
steps: | |
# Checkout the code | |
- uses: actions/checkout@v4 | |
# Install uv | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "0.4.20" | |
enable-cache: true | |
# Test whether the CLI is working | |
- name: Test CLI | |
run: uv run -p ${{ matrix.python-version }} --resolution ${{ matrix.resolution }} seml | |
# Test with pytest | |
- name: Test with pytest | |
run: | | |
cd test | |
uv run -p ${{ matrix.python-version }} --resolution ${{ matrix.resolution }} pytest | |
# Test commands in a dummy environment | |
commands: | |
runs-on: ubuntu-22.04 # this is the lastest release supported by MongoDB | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
resolution: ["highest", "lowest-direct"] | |
# MySQL for Slurm | |
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: Start MongoDB | |
uses: supercharge/[email protected] | |
with: | |
mongodb-username: admin | |
mongodb-password: admin | |
mongodb-port: 27017 | |
- name: Install mongosh | |
run: | | |
sudo apt-get install gnupg | |
wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | sudo tee /etc/apt/trusted.gpg.d/server-7.0.asc | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-mongosh | |
mongosh --version | |
- name: Create seml MongoDB user | |
run: | | |
mongosh --host localhost:27017 -u admin -p admin --authenticationDatabase admin <<EOF | |
db = db.getSiblingDB('seml'); | |
db.createUser({ user: 'seml', pwd: 'seml', roles: [{ role: 'readWrite', db: 'seml' }] }); | |
EOF | |
- name: Setup Slurm Cluster | |
uses: koesterlab/setup-slurm-action@v1 | |
# Checkout the code | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "0.4.20" | |
enable-cache: true | |
- name: Setup virtual env | |
run: uv sync | |
- name: Setup seml config | |
run: uv run seml configure --host=localhost --port=27017 --database=seml --username=seml --password=seml | |
- name: Add | |
run: uv run seml test_collection add ci/examples/example_config.yaml | |
- name: Start | |
run: uv run seml test_collection start | |
- name: Hold | |
run: uv run seml test_collection hold | |
- name: Release | |
run: uv run seml test_collection release | |
- name: Status | |
run: uv run seml test_collection status | |
- name: Queue | |
run: uv run seml queue | |
- name: Cancel | |
run: uv run seml test_collection cancel -y | |
- name: Delete | |
run: uv run seml test_collection delete -y | |
- name: Reload sources | |
run: uv run seml test_collection add ci/examples/example_config.yaml reload-sources -y | |
- name: Set description | |
run: uv run seml test_collection description set -y 'Hello World ${config.dataset}!' | |
- name: List description | |
run: uv run seml test_collection description list | |
- name: Delete description | |
run: uv run seml test_collection description delete -y | |
- name: List | |
run: uv run seml list |