Skip to content

Commit

Permalink
ci: add ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
uptickmetachu committed Apr 18, 2024
1 parent 25f9f6b commit fe821e9
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 53 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Python
on:
push:
branches:
- release/*
- develop
- master
- main
pull_request: {}

permissions:
id-token: write # Required for federated aws oidc
contents: read
actions: read
pull-requests: write

env:
CLUSTER_KEY: ${{secrets.CLUSTER_KEY}}

jobs:
ci:
uses: uptick/actions/.github/workflows/ci.yaml@main
secrets: inherit
with:
python: true
python-version: 3.11
praise-on-fix: false
poetry: true
poetry-install-command: "poetry install"
command: |
curl https://mise.jdx.dev/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
mise settings set experimental true
mise run ci
24 changes: 0 additions & 24 deletions .github/workflows/publish.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

[tools]
poetry = { version = 'latest', pyproject = 'pyproject.toml' }
python = { version= '3.11.*'}
Expand All @@ -20,9 +19,14 @@ depends = ['format', 'ruff-check']
description = "Run all tests"
run = "docker compose run --rm -it dev pytest ."

[tasks."ci:test"]
description = "Run all tests"
run = "docker compose run --rm dev pytest ."
depends = ["build"]

[tasks.ci]
description = "Runs everything for CI"
depends = ['lint', 'test']
depends = ['lint', 'ci:test']

[tasks.install]
description = "Sets up dev dependencies"
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ services:
build:
context: .
dockerfile: Dockerfile
target: dev
develop:
watch:
- action: sync+restart
Expand Down
54 changes: 28 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.8"
description = "Django library for invoking splat"
authors = ["william chu <[email protected]>"]
readme = "README.md"
packages = [{ include = "uptick_splat" }, { include = "test"}]
packages = [{ include = "uptick_splat" }]

[tool.poetry.dependencies]
python = "^3.9"
Expand All @@ -25,29 +25,6 @@ build-backend = "poetry.core.masonry.api"
# Exclude a variety of commonly ignored directories.
line-length = 120

# Enable Pyflakes `E` and `F` codes by default.
select = [
"F", # Pyflakes
"E", # Pycodestyle
"W", # Pycodestyle
"C90", # Mccabe complexity
"C", # flake8-comprehensions
"B", # flake8-bugbear
"UP", # pyupgrade
"S", # bandit (security)
"DTZ", # Enforce good datetime
"BLE", # Blind exceptions
"I", # isort
]

ignore = [
"E501", # Line length is done by black
"D202", # NoBlankLineAfterFunction
"S101", # Use of `assert` detected
"S106", # Ignore secrets
"B008", # Do not perform function call. Lots of false positives with typer.Option
]

# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
Expand All @@ -72,8 +49,33 @@ exclude = [
"api_client",
]

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.10.
target-version = "py311"

[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

ignore = [
"E501", # Line length is done by black
"D202", # NoBlankLineAfterFunction
"S101", # Use of `assert` detected
"S106", # Ignore secrets
"B008", # Do not perform function call. Lots of false positives with typer.Option
]

# Enable Pyflakes `E` and `F` codes by default.
select = [
"F", # Pyflakes
"E", # Pycodestyle
"W", # Pycodestyle
"C90", # Mccabe complexity
"C", # flake8-comprehensions
"B", # flake8-bugbear
"UP", # pyupgrade
"S", # bandit (security)
"DTZ", # Enforce good datetime
"BLE", # Blind exceptions
"I", # isort
]

0 comments on commit fe821e9

Please sign in to comment.