Skip to content

Commit

Permalink
ci: update action to latest standards
Browse files Browse the repository at this point in the history
  • Loading branch information
tagoro9 committed Mar 19, 2024
1 parent 95f48a7 commit 679e00f
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 51 deletions.
8 changes: 0 additions & 8 deletions .fotingorc

This file was deleted.

6 changes: 0 additions & 6 deletions .github/dependabot.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["github>open-turo/renovate-config#v1"]
}
17 changes: 8 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: CI

on:
pull_request:
branches: [main]
workflow_dispatch:
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mfinelli/setup-shfmt@v3
Expand All @@ -20,12 +18,13 @@ jobs:
with:
repository: rhysd/actionlint
- name: Pre-commit
uses: open-turo/action-pre-commit@v3

uses: open-turo/action-pre-commit@v1
- name: Check release notes on pull_request
if: github.event_name == 'pull_request'
uses: open-turo/actions-release/lint-release-notes@v4
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- run: script/test
- uses: actions/checkout@v4
- run: ./script/test
20 changes: 7 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# Sample workflow for building and deploying a MkDocs site to GitHub Pages
name: Deploy MkDocs with GitHub Pages dependencies preinstalled
name: Release

on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "v.*"]

# Allows you to run this workflow manually from the Actions tab
branches: [main, "v*"]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand All @@ -28,7 +24,6 @@ jobs:
uses: actions/checkout@v4
- run: script/test

# Build job
build:
runs-on: ubuntu-latest
steps:
Expand All @@ -46,14 +41,13 @@ jobs:
run: pip install mkdocs[i18n] mkdocs-material
- name: Install Pillow and CairoSVG (required for social card generation)
run: pip install mkdocs-material
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
- name: Release
id: release
uses: open-turo/actions-release/semantic-release@v4
with:
# You can specify specifying version range for the extra plugins if you prefer.
extra_plugins: |
github-token: ${{ secrets.TURO_GITHUB_TOKEN }}
extra-plugins: |
@open-turo/semantic-release-config
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup caching
uses: actions/cache@v4
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/update-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Update dependencies
concurrency: update-dependencies

on:
schedule:
# Every day at midnight
- cron: "0 0 * * *"
workflow_dispatch:
issue_comment:
types:
- edited
pull_request:
types:
- edited

jobs:
update-dependencies:
runs-on: ubuntu-latest
name: Update dependencies
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: open-turo/action-renovate@v1
with:
github-token: ${{ secrets.OPEN_TURO_GITHUB_TOKEN }}
16 changes: 4 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
rev: v4.5.0
hooks:
- id: check-json
- id: check-yaml
- id: pretty-format-json
args:
- --autofix
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.0
rev: v3.1.0
hooks:
- id: prettier
stages: [commit]
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v4.1.0
rev: v9.9.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@open-turo/commitlint-config-conventional"]
- repo: https://github.com/rhysd/actionlint
rev: v1.6.23
rev: v1.6.26
hooks:
- id: actionlint
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0 # or specific git tag
hooks:
- id: shellcheck
- id: shfmt
15 changes: 15 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# script/bootstrap: Resolve all dependencies that the application requires to
# run.

set -e

cd "$(dirname "$0")/.."

# Local only checks
if [[ $CI != "true" ]]; then
echo -e "==> Setting up commit hooks"
pre-commit install
pre-commit install --hook-type commit-msg
fi
10 changes: 10 additions & 0 deletions script/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# script/setup: Set up application for the first time after cloning, or set it
# back to the initial first unused state.

set -e

cd "$(dirname "$0")/.."

script/bootstrap
6 changes: 3 additions & 3 deletions script/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -e
#!/usr/bin/env bash

REPO_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)")"
set -e

"$REPO_DIR/hooks/action-docs/test"
echo "Noop"

0 comments on commit 679e00f

Please sign in to comment.