Skip to content

Commit 405daf7

Browse files
committed
ci: unify workflow file names and titles across the org
- test.yml and coverage.yml merge into ci.yml (CI); the test and coverage job names are unchanged. - release.yaml -> retag.yml (Retag v2): it moves the v2 tag, it does not publish anything. pre-commit.yml is titled pre-commit. - Commit Check and Release Drafter get explicit permissions, like every other workflow. - Dependabot: github-actions monthly and grouped; pip stays daily so a new commit-check release reaches the action at once. - Drop the Probot stale config; LICENSE holder written the same way in every repository.
1 parent bcbadb3 commit 405daf7

9 files changed

Lines changed: 63 additions & 52 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
1+
# Dependabot version updates.
2+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
3+
#
4+
# Same shape in every commit-check repository: monthly, one grouped pull
5+
# request per ecosystem, `chore(deps)` commit subjects. The one exception is
6+
# pip here, which stays daily with no cooldown: requirements.txt pins the
7+
# commit-check release this action ships, and a new release should reach the
8+
# action the day it is published.
59

610
version: 2
711
updates:
812
- package-ecosystem: github-actions
913
directory: /
1014
schedule:
11-
interval: "weekly"
15+
interval: monthly
16+
commit-message:
17+
prefix: chore
18+
include: scope
19+
groups:
20+
github-actions:
21+
patterns:
22+
- "*"
23+
1224
- package-ecosystem: pip
1325
directory: /
1426
schedule:
15-
interval: "daily"
27+
interval: daily
1628
cooldown:
1729
default-days: 0
30+
commit-message:
31+
prefix: chore
32+
include: scope

‎.github/stale.yml‎

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: CI
22

33
permissions:
44
contents: read
@@ -44,3 +44,33 @@ jobs:
4444
4545
- name: Run unit tests
4646
run: python -m pytest main_test.py -v
47+
48+
coverage:
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
52+
with:
53+
# Nothing after checkout needs authenticated git.
54+
persist-credentials: false
55+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
56+
with:
57+
# 3.10 is the real floor, see the test job
58+
python-version: "3.10"
59+
- name: Install dependencies
60+
run: |
61+
pip install -r requirements.txt
62+
pip install pytest pytest-cov
63+
- name: Run tests with coverage
64+
run: |
65+
pytest --cov=main --cov-report=xml --cov-report=term-missing main_test.py
66+
- name: Upload coverage to Codecov
67+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
68+
with:
69+
# Required: main is a protected branch, so Codecov rejects tokenless uploads.
70+
token: ${{ secrets.CODECOV_TOKEN }}
71+
files: ./coverage.xml
72+
flags: unittests
73+
name: codecov-umbrella
74+
# Hard-fail on push to main so a broken upload is visible; on PRs the
75+
# report is informational and a flaky upload should not block review.
76+
fail_ci_if_error: ${{ github.event_name == 'push' }}

‎.github/workflows/commit-check.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Commit Check
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58
branches: 'main'

‎.github/workflows/coverage.yml‎

Lines changed: 0 additions & 41 deletions
This file was deleted.

‎.github/workflows/pre-commit.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run pre-commit
1+
name: pre-commit
22
permissions:
33
contents: read
44

‎.github/workflows/release-drafter.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
- "main"
77
workflow_dispatch:
88

9+
permissions: {}
10+
911
jobs:
1012
draft-release:
13+
permissions:
14+
contents: write
15+
pull-requests: write
1116
uses: commit-check/.github/.github/workflows/release-drafter.yml@main
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: Retag v2
22
permissions:
33
contents: write
44

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 shenxianpeng (xianpeng.shen@gmail.com)
3+
Copyright (c) 2023 Xianpeng Shen
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)