Skip to content

Commit

Permalink
Add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam committed Jan 9, 2024
1 parent f1c4886 commit b164baf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: test

on:
workflow_dispatch:
pull_request:

jobs:
test_linux:
name: "test on linux"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup
run: |
script/setup --dev
- name: test
run: |
script/test
10 changes: 10 additions & 0 deletions script/setup
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
import argparse
import subprocess
import venv
from pathlib import Path
Expand All @@ -7,6 +8,9 @@ _DIR = Path(__file__).parent
_PROGRAM_DIR = _DIR.parent
_VENV_DIR = _PROGRAM_DIR / ".venv"

parser = argparse.ArgumentParser()
parser.add_argument("--dev", action="store_true", help="Install dev requirements")
args = parser.parse_args()

# Create virtual environment
builder = venv.EnvBuilder(with_pip=True)
Expand All @@ -29,3 +33,9 @@ subprocess.check_call(
str(_PROGRAM_DIR / "requirements.txt"),
]
)

if args.dev:
# Install dev requirements
subprocess.check_call(
pip + ["install", "-r", str(_PROGRAM_DIR / "requirements_dev.txt")]
)

0 comments on commit b164baf

Please sign in to comment.