Skip to content

Commit

Permalink
Merge pull request #302 from camptocamp/c2cciutils-upgrade-2.1
Browse files Browse the repository at this point in the history
CI updates
  • Loading branch information
sbrunner authored Nov 30, 2023
2 parents dc4e463 + 555e2d8 commit 83b3c64
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Backport

on:
pull_request:
types:
- closed
- labeled

env:
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}

jobs:
backport:
runs-on: ubuntu-22.04
name: Backport
timeout-minutes: 5

steps:
- uses: camptocamp/backport-action@master
with:
token: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}
if: env.HAS_SECRETS == 'HAS_SECRETS'
51 changes: 51 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Changelog Generator

on:
schedule:
- cron: 0 0 * * 1,4
push:
tags:
- "*.*.*"

jobs:
changelog:
name: Changelog Generator
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
if: github.event_name == 'push' && github.ref_type == 'tag'
- name: Create release
run: |-
if [[ ${{ github.ref_name }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
gh release create ${{ github.ref_name }} --generate-notes || true
fi
if: github.event_name == 'push' && github.ref_type == 'tag'
env:
GH_TOKEN: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}

- name: Get Date
id: get-date
run: echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: .cache
key: automation-${{ steps.get-date.outputs.date }}
restore-keys: |+
automation-
- run: docker pull aeonphp/automation
- name: Generate changelog
run: >-
docker run --env=AEON_AUTOMATION_GH_TOKEN --rm --volume=$(pwd)/.cache:/cache aeonphp/automation
changelog:generate:all
${{ github.repository }}
--github-release-update
--cache-path=/cache
--skip-from=dependabot-preview[bot]
--skip-from=dependabot[bot]
--skip-from=renovate[bot]
-v
env:
AEON_AUTOMATION_GH_TOKEN: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/dependency-auto-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Auto reviews updates

on:
pull_request:
types:
- opened
- reopened

jobs:
auto-merge:
name: Auto reviews updates
runs-on: ubuntu-22.04
timeout-minutes: 5
if: github.event.pull_request.user.login == 'renovate[bot]'

steps:
- uses: actions/github-script@v7
with:
script: |-
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE',
})
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

name: Continuous integration

on:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Pull request check

on:
pull_request:
types:
- opened
- reopened
- labeled
- unlabeled
- edited
- synchronize

jobs:
build:
name: Pull request check
runs-on: ubuntu-22.04
timeout-minutes: 5
if: github.event.pull_request.user.login != 'renovate[bot]'

steps:
- run: pip install --upgrade attrs
- uses: actions/checkout@v4

- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --pre c2cciutils[pr_checks]

- name: Check pull request
run: c2cciutils-pull-request-checks
env:
GITHUB_EVENT: ${{ toJson(github) }}
GITHUB_TOKEN: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
additional_dependencies:
- [email protected] # npm
4 changes: 3 additions & 1 deletion ci/config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/c2cciutils/master/c2cciutils/schema.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/c2cciutils/1.3.7/c2cciutils/schema.json

publish:
docker:
images: []
pypi:
versions:
- version_tag
checks:
required_workflows: false

0 comments on commit 83b3c64

Please sign in to comment.