Skip to content

Commit

Permalink
Merge pull request #169 from CooperUnion/user/jacobkoziej/yaml-sanity
Browse files Browse the repository at this point in the history
YAML Sanity
  • Loading branch information
jacobkoziej authored Oct 23, 2023
2 parents f3f4bc4 + 09b0952 commit ef14552
Show file tree
Hide file tree
Showing 31 changed files with 1,786 additions and 1,545 deletions.
9 changes: 6 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---

version: 2

updates:
- package-ecosystem: "pip"
directory: "/"
- package-ecosystem: pip
directory: /
schedule:
interval: "daily"
interval: daily
1 change: 1 addition & 0 deletions .github/workflows/mdbook-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

name: mdbook-deploy

# yamllint disable-line rule:truthy
on:
push:
branches:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

name: mdbook

# yamllint disable-line rule:truthy
on:
pull_request:
pull_request: ~

jobs:
build:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/node_bl.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---

name: Build node_bl

# node_bl job triggers disabled for now while bootloader is under rework
# on: [pull_request, push, workflow_dispatch]
# yamllint disable-line rule:truthy
on: workflow_dispatch

jobs:
Expand Down Expand Up @@ -41,13 +44,13 @@ jobs:
- name: Build firmware
run: . .venv/bin/activate && make dbw/node_bl

- name: 'Upload CAN network'
- name: Upload CAN network
uses: actions/upload-artifact@v3
with:
name: can-dbc
path: build/can/igvc_can.dbc

- name: 'Upload firmware binaries'
- name: Upload firmware binaries
uses: actions/upload-artifact@v3
with:
name: node_bl-bin
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/node_fw.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---

name: Build node_fw

on: [pull_request, push, workflow_dispatch]
# yamllint disable-line rule:truthy
on:
- pull_request
- push
- workflow_dispatch

jobs:
pre_job:
Expand All @@ -17,7 +23,7 @@ jobs:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

name: pre-commit

# yamllint disable-line rule:truthy
on:
pull_request:
push:
pull_request: ~
push: ~

jobs:
pre-commit:
Expand Down
72 changes: 39 additions & 33 deletions .github/workflows/sync-dev.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
---

name: Sync `master` to `dev`

# yamllint disable-line rule:truthy
on:
push:
branches:
- master
- master

jobs:
make-sync-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create source branch
run: |
git config --global push.autoSetupRemote true
git checkout -b 'bot-branches/sync-master-dev-${{ github.sha }}'
git push
- uses: actions/checkout@v3
- name: Create source branch
run: |
git config --global push.autoSetupRemote true
git checkout -b 'bot-branches/sync-master-dev-${{ github.sha }}'
git push
- name: Make PR
id: make-pr
uses: repo-sync/pull-request@v2
with:
source_branch: 'bot-branches/sync-master-dev-${{ github.sha }}'
destination_branch: dev
github_token: ${{ secrets.BOT_PAT_SELFDRIVE }}
pr_title: '[SYNC-FIX] Merge out-of-sync changes from \`master\` into \`dev\`:grey_exclamation:'
pr_body: |
Hello! This PR has been automatically generated because you need to merge out-of-sync changes from \`master\` into \`dev\`.
- name: Make PR
id: make-pr
uses: repo-sync/pull-request@v2
with:
source_branch: bot-branches/sync-master-dev-${{ github.sha }}
destination_branch: dev
github_token: ${{ secrets.BOT_PAT_SELFDRIVE }}
pr_title: >
'[SYNC-FIX] Merge out-of-sync changes from \`master\` into
\`dev\`:grey_exclamation:'
pr_body: >
Hello! This PR has been automatically generated because you need to
merge out-of-sync changes from \`master\` into \`dev\`.
**I will try to merge this PR on my own!**
pr_label: 'autosync,URGENT'
pr_allow_empty: true
**I will try to merge this PR on my own!**
pr_label: autosync,URGENT
pr_allow_empty: true

- name: Set automerge
if: ${{ steps.make-pr.outputs.pr_number != '' }}
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.BOT_PAT_SELFDRIVE }}
pull-request-number: ${{ steps.make-pr.outputs.pr_number }}
merge-method: merge
- name: Set automerge
if: ${{ steps.make-pr.outputs.pr_number != '' }}
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.BOT_PAT_SELFDRIVE }}
pull-request-number: ${{ steps.make-pr.outputs.pr_number }}
merge-method: merge

- name: Approve PR
if: ${{ steps.make-pr.outputs.pr_number != '' }}
uses: hmarr/auto-approve-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # approve as GH Actions
pull-request-number: ${{ steps.make-pr.outputs.pr_number }}
- name: Approve PR
if: ${{ steps.make-pr.outputs.pr_number != '' }}
uses: hmarr/auto-approve-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # approve as GH Actions
pull-request-number: ${{ steps.make-pr.outputs.pr_number }}
14 changes: 13 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ repos:
rev: 0.7.17
hooks:
- id: mdformat
args: [--wrap, '72']
args:
- --wrap
- '72'
exclude: LICENSE\.md
additional_dependencies:
- mdformat-gfm
Expand All @@ -34,3 +36,13 @@ repos:
rev: v0.1.1
hooks:
- id: ruff

- repo: https://github.com/lyz-code/yamlfix/
rev: 1.13.0
hooks:
- id: yamlfix

- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
7 changes: 7 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

extends: default

ignore-from-file:
- .gitignore
- common/.gitignore
Loading

0 comments on commit ef14552

Please sign in to comment.