Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: update GitHub Actions workflows #10

Merged
merged 6 commits into from
Oct 9, 2023
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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PYTHONHASHSEED: "0"

on:
push:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
pull_request:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
workflow_dispatch:
inputs:
specific-pip-packages:
description: Run CI with specific pip packages
required: false
type: string

jobs:
style:
if: inputs.specific-pip-packages == ''
secrets:
token: ${{ secrets.PAT }}
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v1
22 changes: 22 additions & 0 deletions .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Clean caches

on:
pull_request:
types:
- closed
workflow_dispatch:
inputs:
ref:
description: Clean caches for this branch name or ref
required: false
type: string

jobs:
cleanup:
name: Remove caches
runs-on: ubuntu-22.04
steps:
- uses: ComPWA/actions/clean-caches@v1
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.ref }}
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ jobs:
packages: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: docker/login-action@v2
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- uses: docker/build-push-action@v4
- uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PR linting
on:
pull_request:
types:
- edited
- labeled
- opened
- reopened
- synchronize
- unlabeled

jobs:
check-labels:
name: Check labels
runs-on: ubuntu-22.04
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest # cspell:ignore agilepathway
with:
any_of: >-
🐛 Bug,✨ Feature,⚙️ Enhancement,⚠️ Interface,❗ Behavior,📝 Docs,🔨 Maintenance,🖱️ DX
none_of: Epic,💫 Good first issue
repo_token: ${{ secrets.GITHUB_TOKEN }}

check-title:
name: Check title
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: npm install @compwa/commitlint-config
- name: Create commitlint config
run: |
echo "module.exports = {extends: ['@compwa/commitlint-config']}" > commitlint.config.js
- uses: JulienKode/[email protected] # cspell:ignore kode
2 changes: 1 addition & 1 deletion .github/workflows/update-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Upgrade hook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
Expand Down
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_schedule: quarterly
skip:
- taplo

repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.1.0
hooks:
- id: check-dev-files
args:
- --ignore-author
- --no-github-actions
- --no-gitpod
- --no-prettierrc
- --no-python
- --no-version-branches
- --repo-name=mirrors-taplo

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.1
hooks:
- id: taplo

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort
args:
- --in-place
38 changes: 19 additions & 19 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
- id: taplo
name: taplo-cli
description: "A TOML toolkit written in Rust"
entry: taplo format
language: rust
types: [toml]
args: []
require_serial: false
additional_dependencies: ["cli:taplo-cli:0.8.1"]
minimum_pre_commit_version: "0"
- id: taplo
name: taplo-cli
description: "A TOML toolkit written in Rust"
entry: taplo format
language: rust
types: [toml]
args: []
require_serial: false
additional_dependencies: ["cli:taplo-cli:0.8.1"]
minimum_pre_commit_version: "0"

- id: taplo-docker
name: taplo-cli-docker
description: "A TOML toolkit written in Rust"
entry: tamasfe/taplo:0.8.1
language: docker_image
types: [toml]
args: [format]
require_serial: false
minimum_pre_commit_version: "0"
- id: taplo-docker
name: taplo-cli-docker
description: "A TOML toolkit written in Rust"
entry: tamasfe/taplo:0.8.1
language: docker_image
types: [toml]
args: [format]
require_serial: false
minimum_pre_commit_version: "0"
9 changes: 8 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"garaioag.garaio-vscode-unwanted-recommendations",
"github.vscode-github-actions",
"ms-azuretools.vscode-docker",
"ms-python.python",
"redhat.vscode-yaml"
"redhat.vscode-yaml",
"stkb.rewrap"
],
"unwantedRecommendations": [
"davidanson.vscode-markdownlint",
"travisillig.vscode-json-stable-stringify"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"[git-commit]": {
"editor.rulers": [72],
"rewrap.wrappingColumn": 72
},
"editor.formatOnSave": true,
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"rewrap.wrappingColumn": 88
}
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "__fake_crate"
version = "0.0.0"

[[bin]]
name = "__fake_cmd"
path = "main.rs"

[package]
name = "__fake_crate"
version = "0.0.0"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:22.04

RUN apt-get update \
RUN apt-get update \
&& apt-get install -y \
curl \
git \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Taplo mirror

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Mirror of [Taplo](https://github.com/tamasfe/taplo) for [pre-commit](https://pre-commit.com), created with a modified version of [`pre-commit-mirror-maker`](https://github.com/pre-commit/pre-commit-mirror-maker) (see [this workflow](./.github/workflows/update-tags.yml)).

### Using Taplo with pre-commit
Expand Down
Loading