Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on:
workflow_call:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
python-lint:
name: "Python Lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4

- name: Lint with tox
run: uvx tox -e lint

workflow-lint:
name: Lint GitHub Actions workflows
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Check workflows with actionlint
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
tool_dir="$RUNNER_TEMP/actionlint"
archive=actionlint_1.7.12_linux_amd64.tar.gz
gh release download v1.7.12 --repo rhysd/actionlint \
--pattern "$archive" --dir "$tool_dir"
printf '%s %s\n' \
'8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8' \
"$tool_dir/$archive" | sha256sum --check
tar -xzf "$tool_dir/$archive" -C "$tool_dir"
"$tool_dir/actionlint" -shellcheck= -pyflakes=

test:
name: "Python Test ${{ matrix.os }}"
needs: [python-lint]
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false # allow tests to run on all platforms
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest

steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4

- name: Test with tox
run: uvx tox
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
ci:
needs: preflight
uses: ./.github/workflows/test-suite.yml
uses: ./.github/workflows/ci.yml
build:
needs: [preflight, ci]
runs-on: ubuntu-latest
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/test-suite.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![PyPI - Downloads](https://img.shields.io/pypi/dm/python-json-logger)](https://pypi.python.org/pypi/python-json-logger/)
[![Python Versions](https://img.shields.io/pypi/pyversions/python-json-logger.svg)](https://github.com/nhairs/python-json-logger)
[![License](https://img.shields.io/github/license/nhairs/python-json-logger.svg)](https://github.com/nhairs/python-json-logger)
![Build Status](https://github.com/nhairs/python-json-logger/actions/workflows/test-suite.yml/badge.svg)
![Build Status](https://github.com/nhairs/python-json-logger/actions/workflows/ci.yml/badge.svg)
#
# Python JSON Logger

Expand Down
19 changes: 19 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ pytest

The above commands (`black`, `pylint`, `pyrefly `, `pytest`) should all be run before submitting a pull request.

#### GitHub Actions workflow linting

Pull-request CI checks every workflow in `.github/workflows` with `actionlint`.
To run the same check locally, download the archive for your platform from the
[actionlint v1.7.12 release](https://github.com/rhysd/actionlint/releases/tag/v1.7.12).
Verify its SHA-256 digest against the release's `actionlint_1.7.12_checksums.txt`
file, then extract the binary and add it to your `PATH`.

Run this command from the repository root.

```shell
actionlint -shellcheck= -pyflakes=
```

These flags disable the optional ShellCheck and Pyflakes integrations in both
local runs and CI.

#### Documentation preview

If making changes to the documentation you can preview the changes locally using `mkdocs`. Changes to the `README.md` can be previewed using a tool like [`grip`](https://github.com/joeyespo/grip) (installable via `pip install grip`).

```shell
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![PyPI - Downloads](https://img.shields.io/pypi/dm/python-json-logger)](https://pypi.python.org/pypi/python-json-logger/)
[![Python Versions](https://img.shields.io/pypi/pyversions/python-json-logger.svg)](https://github.com/nhairs/python-json-logger)
[![License](https://img.shields.io/github/license/nhairs/python-json-logger.svg)](https://github.com/nhairs/python-json-logger)
![Build Status](https://github.com/nhairs/python-json-logger/actions/workflows/test-suite.yml/badge.svg)
![Build Status](https://github.com/nhairs/python-json-logger/actions/workflows/ci.yml/badge.svg)

## Introduction

Expand Down
Loading