From 792926f3f515b45e81a9c30f37d6306f63530e09 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 14:24:07 +0200 Subject: [PATCH 1/6] Clean up github actions --- .github/file-filters.yml | 15 ------------- .github/workflows/files-changed.yml | 24 ++++++++++++++++----- .github/workflows/pull-compliance-docs.yml | 25 ---------------------- .github/workflows/pull-compliance.yml | 18 ++++++++++++++++ 4 files changed, 37 insertions(+), 45 deletions(-) delete mode 100644 .github/file-filters.yml delete mode 100644 .github/workflows/pull-compliance-docs.yml diff --git a/.github/file-filters.yml b/.github/file-filters.yml deleted file mode 100644 index 26231c936423e..0000000000000 --- a/.github/file-filters.yml +++ /dev/null @@ -1,15 +0,0 @@ -docs: &docs - - "**/*.md" - - "docs/**" - -backend: &backend - - "**/*.go" - - "**/*.tmpl" - - "go.mod" - - "go.sum" - -frontend: &frontend - - "**/*.js" - - "web_src/**" - - "package.json" - - "package-lock.json" diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index 2efd6767197d1..16bd276871b93 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -1,4 +1,4 @@ -name: files changed +name: files-changed on: workflow_call: @@ -14,7 +14,7 @@ on: value: ${{ jobs.files-changed.outputs.frontend }} jobs: - files-changed: + detect: name: detect which files changed runs-on: ubuntu-latest timeout-minutes: 3 @@ -25,8 +25,22 @@ jobs: frontend: ${{ steps.changes.outputs.frontend }} 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: + docs: + - "**/*.md" + - "docs/**" + + backend: + - "**/*.go" + - "**/*.tmpl" + - "go.mod" + - "go.sum" + + frontend: + - "**/*.js" + - "web_src/**" + - "package.json" + - "package-lock.json" diff --git a/.github/workflows/pull-compliance-docs.yml b/.github/workflows/pull-compliance-docs.yml deleted file mode 100644 index 0f6720a64dccf..0000000000000 --- a/.github/workflows/pull-compliance-docs.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: compliance-docs - -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - files-changed: - uses: ./.github/workflows/files-changed.yml - - compliance-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 diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index e108379b3096a..6be793f9c6459 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -113,3 +118,16 @@ 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 From 6fc14217f9cd13fb64c41e177d133e7038bb2cbc Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 17:48:35 +0200 Subject: [PATCH 2/6] add actions lint step --- .github/workflows/files-changed.yml | 11 +++++++---- .github/workflows/pull-compliance.yml | 9 +++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index 16bd276871b93..c229ce469ab5e 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -29,10 +29,6 @@ jobs: id: changes with: filters: - docs: - - "**/*.md" - - "docs/**" - backend: - "**/*.go" - "**/*.tmpl" @@ -44,3 +40,10 @@ jobs: - "web_src/**" - "package.json" - "package-lock.json" + + docs: + - "**/*.md" + - "docs/**" + + actions: + - ".github/workflows/*" diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 6be793f9c6459..b7c1ab8a33c82 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -131,3 +131,12 @@ jobs: - 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 From 27493d67ff71848c36bcc14bcef8dc7a7d8cce48 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 17:51:30 +0200 Subject: [PATCH 3/6] add mapping entries and sort --- .github/workflows/files-changed.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index c229ce469ab5e..b1e6183da62a3 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -3,15 +3,18 @@ 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 }} frontend: description: "whether frontend files changed" value: ${{ jobs.files-changed.outputs.frontend }} + docs: + description: "whether docs files changed" + value: ${{ jobs.files-changed.outputs.docs }} + actions: + description: "whether actions files changed" + value: ${{ jobs.files-changed.outputs.actions }} jobs: detect: @@ -20,9 +23,10 @@ jobs: 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 - uses: dorny/paths-filter@v2 @@ -34,16 +38,13 @@ jobs: - "**/*.tmpl" - "go.mod" - "go.sum" - frontend: - "**/*.js" - "web_src/**" - "package.json" - "package-lock.json" - docs: - "**/*.md" - "docs/**" - actions: - ".github/workflows/*" From a6d85810bf29eecdae49987981a94a88dd4250cc Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 17:54:55 +0200 Subject: [PATCH 4/6] fix lint --- .github/workflows/files-changed.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index b1e6183da62a3..9a9c54720b453 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -5,16 +5,16 @@ on: outputs: 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.files-changed.outputs.docs }} + value: ${{ jobs.detect.outputs.docs }} actions: description: "whether actions files changed" - value: ${{ jobs.files-changed.outputs.actions }} + value: ${{ jobs.detect.outputs.actions }} jobs: detect: @@ -32,19 +32,22 @@ jobs: - uses: dorny/paths-filter@v2 id: changes with: - filters: + filters: | backend: - "**/*.go" - "**/*.tmpl" - "go.mod" - "go.sum" + frontend: - "**/*.js" - "web_src/**" - "package.json" - "package-lock.json" + docs: - "**/*.md" - "docs/**" + actions: - ".github/workflows/*" From e9429587253e92104dcf460887af7fb1f6d63cb2 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 18:17:41 +0200 Subject: [PATCH 5/6] test if actionlint works --- .github/workflows/files-changed.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index 9a9c54720b453..a074db48b5acf 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -5,7 +5,7 @@ on: outputs: backend: description: "whether backend files changed" - value: ${{ jobs.detect.outputs.backend }} + value: ${{ jobs.xdetect.outputs.backend }} frontend: description: "whether frontend files changed" value: ${{ jobs.detect.outputs.frontend }} From d843bb97260af02fb3e18a1b0515bbc72f26d12f Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 18:19:07 +0200 Subject: [PATCH 6/6] Revert "test if actionlint works" This reverts commit e9429587253e92104dcf460887af7fb1f6d63cb2. --- .github/workflows/files-changed.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index a074db48b5acf..9a9c54720b453 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -5,7 +5,7 @@ on: outputs: backend: description: "whether backend files changed" - value: ${{ jobs.xdetect.outputs.backend }} + value: ${{ jobs.detect.outputs.backend }} frontend: description: "whether frontend files changed" value: ${{ jobs.detect.outputs.frontend }}