Skip to content

Commit

Permalink
get workflows to run
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea committed May 31, 2023
1 parent e025f05 commit a50eb4f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:

jobs:
publish:
uses: ./.github/workflows/.nox-session.yml
uses: ./.github/workflows/.hatch-run.yml
with:
job-name: "publish"
nox-args: "-s publish"
hatch-run: "publish"
secrets:
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
pypi-username: ${{ secrets.PYPI_USERNAME }}
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,21 @@ jobs:
uses: ./.github/workflows/.hatch-run.yml
with:
job-name: "python-{0}"
hatch-run: "-t check-python"
nox-session-args: "--pytest --maxfail=3 --reruns 3"
hatch-run: "test-py --maxfail=3 --reruns=3 lint-py"
python-environments:
uses: ./.github/workflows/.nox-session.yml
uses: ./.github/workflows/.hatch-run.yml
with:
job-name: "python-{0} {1}"
nox-args: "-s check-python-tests"
nox-session-args: "--no-cov --pytest --maxfail=3 --reruns 3"
hatch-run: "test-py --maxfail=3 --reruns=3 --no-cov"
runs-on-array: '["ubuntu-latest", "macos-latest", "windows-latest"]'
python-version-array: '["3.9", "3.10", "3.11"]'
docs:
uses: ./.github/workflows/.nox-session.yml
uses: ./.github/workflows/.hatch-run.yml
with:
job-name: "python-{0}"
nox-args: "-s check-docs"
hatch-run: "test-docs"
javascript:
uses: ./.github/workflows/.nox-session.yml
uses: ./.github/workflows/.hatch-run.yml
with:
job-name: "{1}"
nox-args: "-t check-javascript"
hatch-run: "test-js lint-js"
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ post-install-commands = ["invoke env"]
[tool.hatch.envs.default.scripts]
publish = "invoke publish {args}"

checks = ["lint", "test"]
lint = ["lint-py {args}", "lint-js {args}"]
test = ["test-py", "test-js"]

lint-py = "invoke lint-py {args}"
lint-js = "invoke lint-js {args}"

test-py = "invoke test-py {args}"
test-js = "invoke test-js {args}"
test-docs = "invoke test-docs {args}"

# --- Black ----------------------------------------------------------------------------

Expand Down
10 changes: 8 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ def lint_js(context: Context, fix: bool = False):


@task
def test_py(context: Context, no_cov: bool = False):
def test_py(context: Context, no_cov: bool = False, **flags: str):
"""Run test suites"""
in_py(context, f"hatch run {'test' if no_cov else 'cov'}")
flags = " ".join(f"--{k}={v}" for k, v in flags.items())
in_py(context, f"hatch run {'test' if no_cov else 'cov'} {flags}")


@task
Expand All @@ -94,6 +95,11 @@ def test_js(context: Context):
in_js(context, "npm run check:tests")


@task
def test_docs(context: Context):
raise Exit("Not implemented")


@task
def publish(context: Context, dry_run: str = ""):
"""Publish packages that have been tagged for release in the current commit
Expand Down

0 comments on commit a50eb4f

Please sign in to comment.