Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up github actions #24984

Merged
merged 8 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/file-filters.yml

This file was deleted.

43 changes: 32 additions & 11 deletions .github/workflows/files-changed.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
name: files changed
name: files-changed

on:
workflow_call:
outputs:
docs:
description: "whether docs files changed"
value: ${{ jobs.files-changed.outputs.docs }}
backend:
description: "whether backend files changed"
value: ${{ jobs.files-changed.outputs.backend }}
value: ${{ jobs.detect.outputs.backend }}
frontend:
description: "whether frontend files changed"
value: ${{ jobs.files-changed.outputs.frontend }}
value: ${{ jobs.detect.outputs.frontend }}
docs:
description: "whether docs files changed"
value: ${{ jobs.detect.outputs.docs }}
actions:
description: "whether actions files changed"
value: ${{ jobs.detect.outputs.actions }}

jobs:
files-changed:
detect:
name: detect which files changed
runs-on: ubuntu-latest
timeout-minutes: 3
# Map a step output to a job output
outputs:
docs: ${{ steps.changes.outputs.docs }}
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
docs: ${{ steps.changes.outputs.docs }}
actions: ${{ steps.changes.outputs.actions }}
steps:
- uses: actions/checkout@v3
- name: Check for backend file changes
uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v2
id: changes
with:
filters: .github/file-filters.yml
filters: |
backend:
- "**/*.go"
- "**/*.tmpl"
- "go.mod"
- "go.sum"

frontend:
- "**/*.js"
- "web_src/**"
- "package.json"
- "package-lock.json"

docs:
- "**/*.md"
- "docs/**"

actions:
- ".github/workflows/*"
25 changes: 0 additions & 25 deletions .github/workflows/pull-compliance-docs.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/pull-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- run: make lint-backend
env:
TAGS: bindata sqlite sqlite_unlock_notify

lint-go-windows:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
Expand All @@ -41,6 +42,7 @@ jobs:
TAGS: bindata sqlite sqlite_unlock_notify
GOOS: windows
GOARCH: amd64

lint-go-gogit:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
Expand All @@ -55,6 +57,7 @@ jobs:
- run: make lint-go
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify

checks-backend:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
Expand All @@ -67,6 +70,7 @@ jobs:
check-latest: true
- run: make deps-backend deps-tools
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs

frontend:
if: needs.files-changed.outputs.frontend == 'true'
needs: files-changed
Expand All @@ -79,6 +83,7 @@ jobs:
- run: make deps-frontend
- run: make lint-frontend
- run: make checks-frontend

backend:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
Expand Down Expand Up @@ -113,3 +118,25 @@ jobs:
env:
GOOS: linux
GOARCH: 386

docs:
if: needs.files-changed.outputs.docs == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-md
- run: make docs # test if build could succeed

actions:
if: needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- run: make lint-actions