Skip to content

Commit

Permalink
Added actionlint to validate workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo committed Feb 2, 2024
1 parent d556cc7 commit 935a89c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
File renamed without changes.
21 changes: 16 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Build
on:
workflow_dispatch:
workflow_call:
Expand All @@ -16,14 +16,14 @@ permissions:
jobs:
build:
name: Build
runs-on: macos-latest
runs-on: macos-latest # we also build on iOS for multiplatform
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup host
uses: ./.github/workflows/setup-host
uses: ./.github/actions/setup-host
- name: Test & Build
run: ./gradlew -s build
- name: Publish Test Report
Expand All @@ -33,7 +33,18 @@ jobs:
report_paths: '**/build/test-results/*/TEST-*.xml'
- name: Coverage report
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
- name: Simulate Publish
run: ./gradlew -p plugins publish -sm

actionlint:
name: Validate Workflows
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download actionlint
shell: bash
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
- name: Check workflow files
shell: bash
run: ./actionlint -color -format '{{range $err := .}}::error file={{$err.Filepath}},line={{$err.Line}},col={{$err.Column}}::{{$err.Message}}%0A```%0A{{replace $err.Snippet "\\n" "%0A"}}%0A```\n{{end}}' -ignore 'SC2016:'
7 changes: 3 additions & 4 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
name: Dependabot auto-merge
on:
on:
pull_request:
types: [ opened, synchronize, reopened, labeled ]

Expand All @@ -14,7 +14,6 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'dependencies') }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --rebase "$PR_URL"
run: gh pr merge --auto --rebase ${{ github.event.pull_request.html_url }}
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ github.token }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: Release
on:
release:
types: [published]
Expand All @@ -18,7 +18,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup host
uses: ./.github/workflows/setup-host
uses: ./.github/actions/setup-host
- name: Publish
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-gradle-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup host
uses: ./.github/workflows/setup-host
uses: ./.github/actions/setup-host
- name: Update Gradle Wrapper
uses: gradle-update/update-gradle-wrapper-action@v1
with:
Expand Down

0 comments on commit 935a89c

Please sign in to comment.