From 13674f250dea405c9eee96ebb3f87a70067f4b70 Mon Sep 17 00:00:00 2001 From: Agustinus Kristiadi Date: Thu, 4 Jul 2024 11:38:51 -0400 Subject: [PATCH] Add Github workflows for test, lint, and formatting --- .github/workflows/format-ruff.yml | 12 ++++++++++++ .github/workflows/lint-ruff.yml | 12 ++++++++++++ .github/workflows/pytest.yml | 19 +++++++++++++++++++ .pdm-python | 2 +- 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/format-ruff.yml create mode 100644 .github/workflows/lint-ruff.yml create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/format-ruff.yml b/.github/workflows/format-ruff.yml new file mode 100644 index 0000000..50190fc --- /dev/null +++ b/.github/workflows/format-ruff.yml @@ -0,0 +1,12 @@ +name: ruff-format + +on: pull_request + +jobs: + ruff-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 + with: + args: "format --check" diff --git a/.github/workflows/lint-ruff.yml b/.github/workflows/lint-ruff.yml new file mode 100644 index 0000000..be99ccf --- /dev/null +++ b/.github/workflows/lint-ruff.yml @@ -0,0 +1,12 @@ +name: ruff-lint + +on: pull_request + +jobs: + ruff-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 + with: + args: 'check' diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..9939ef6 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,19 @@ +name: pytest + +on: pull_request + +jobs: + pytest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up PDM + uses: pdm-project/setup-pdm@v3 + with: + python-version: 3.9 + - name: Install dependencies + run: | + pdm sync -d + - name: Test with pytest + run: | + pdm run -v pytest tests diff --git a/.pdm-python b/.pdm-python index 7dc98b7..809fa70 100644 --- a/.pdm-python +++ b/.pdm-python @@ -1 +1 @@ -/Users/akristiadi/.pyenv/shims/python3 \ No newline at end of file +/Users/agustinuskristiadi/Projects/ults/.venv/bin/python \ No newline at end of file