From dddebcd64fefd86a28fd1edb61c06a0f2416e39f Mon Sep 17 00:00:00 2001 From: gram Date: Thu, 28 Sep 2023 15:18:35 +0200 Subject: [PATCH 1/2] CI (Github Actions) --- .drone.star | 46 ------------------------------- .github/workflows/main.yml | 56 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 46 deletions(-) delete mode 100644 .drone.star create mode 100644 .github/workflows/main.yml diff --git a/.drone.star b/.drone.star deleted file mode 100644 index 3a211ec..0000000 --- a/.drone.star +++ /dev/null @@ -1,46 +0,0 @@ -def main(ctx): - return dict( - kind="pipeline", - type="docker", - name="default", - trigger=dict( - branch="master", - ), - steps=[ - dict( - name="install task", - image="alpine:latest", - commands=[ - "apk add --no-cache wget", - "wget https://taskfile.dev/install.sh", - "sh install.sh -- latest", - "rm install.sh", - ], - ), - step(env="pytest", python="3.7"), - step(env="pytest", python="3.8"), - step(env="pytest", python="3.9"), - step(env="pytest", python="3.10"), - step(env="flake8", python="3.8"), - step(env="mypy", python="3.8"), - ], - ) - - -def step(env, python): - result = dict( - name="{} (py{})".format(env, python), - image="python:{}-slim-buster".format(python), - depends_on=["install task"], - environment=dict( - # set coverage database file name to avoid conflicts between steps - COVERAGE_FILE=".coverage.{}.{}".format(env, python), - ), - commands=[ - "./bin/task VENVS=/opt/py{python} -f {env}:run".format( - python=python, - env=env, - ), - ], - ) - return result diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..164dc7e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,56 @@ +name: main + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.8" + - uses: arduino/setup-task@v1 + with: + repo-token: ${{ github.token }} + - run: task lint + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + # - "3.12.0-rc.3" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - uses: arduino/setup-task@v1 + with: + repo-token: ${{ github.token }} + - run: task test + + markdownlint-cli: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: nosborn/github-action-markdown-cli@v3.2.0 + with: + files: . + config_file: .markdownlint.yaml + dot: true From 3df96cbfe13699ca7bb80a8da94c5028fbbb6ee1 Mon Sep 17 00:00:00 2001 From: gram Date: Thu, 28 Sep 2023 15:20:43 +0200 Subject: [PATCH 2/2] add markdownlint config --- .markdownlint.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .markdownlint.yaml diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..808d2a6 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,8 @@ +# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml +default: true # enable all by default +MD007: # unordered list indentation + indent: 2 +MD013: false # do not validate line length +MD014: false # allow $ before command output +MD029: # ordered list prefix + style: "one"