From 9a4ac6c100844cdbe1a8687dd254bf22f5747129 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 12:12:46 -0400 Subject: [PATCH 01/23] ci: only run jobs when relevant files have been changed - e.g. don't run E2E tests if only UI or only Docs have changed - or don't run UI CI when UI has not chaged - use [`tj-actions/changed-files`](https://github.com/tj-actions/changed-files) action for this - the most popular and full featured one I could find - run `changed-files` in its own job that must run before all other jobs - have it `output` booleans for specific changes -- limit all the `changed_files` nuances, naming, syntax, etc to that one job - job `outputs` are also needed for skipping other jobs, as step outputs can't be directly accessed - see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs and https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context - have other jobs specify it in their `needs` and then skip if not needed with `if` - use multi-output variant of `changed-files` YAML directive - so can check e2e vs docs vs UI etc - use `any_modified` as that includes added, copied, modified, renamed, and deleted (ACMRD) - `any_changed` does not include deletions NOTE: I realized after that `docs` isn't a job, `lint` is, so there's gonna be some follow-up commits - and well need to test anyway too - will also include the `all` list _after_ testing, since it would make everything run Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 82 +++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index e556b39c4b26..0cce6db59396 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -17,6 +17,77 @@ permissions: contents: read jobs: + changed-files: + name: Check changed files + outputs: + # reference: https://github.com/tj-actions/changed-files#outputs- + all: ${{ steps.changed-files.outputs.all_any_modified == 'true' }} + e2e-tests: ${{ steps.changed-files.outputs.e2e-tests_any_modified == 'true' }} + codegen: ${{ steps.changed-files.outputs.codegen_any_modified == 'true' }} + docs: ${{ steps.changed-files.outputs.docs_any_modified == 'true' }} + ui: ${{ steps.changed-files.outputs.ui_any_modified == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 50 # assume PRs are less than 50 commits + - name: Check if relevant files were changed per group + id: changed-files + uses: tj-actions/changed-files@v39 + with: + files: | + all: + - .github/workflows/ci-build.yaml + e2e-tests: + - cmd/** + - config/** + - errors/** + - manifests/** + - persist/** + - pkg/** + - sdks/** + - server/** + - test/** + - util/** + - workflow/** + codegen: + # generated files + - api/** + - docs/fields.md + - docs/executor_swagger.md + - docs/cli/** + - pkg/** + - sdks/java/** + - sdks/python/** + # examples are used within the fields lists + - examples/** + # generation scripts + - hack/cli/** + - hack/jsonschema/** + - hack/swagger/** + - hack/auto-gen-msgh.sh + - hack/crdgen.sh + - hack/crds.go + - hack/docgen.go + - hack/parse_examples.go + - hack/swaggify.sh + - .clang-format + docs: + - docs/** + # generated files are covered by codegen + - !docs/fields.md + - !docs/executor_swagger.md + - !docs/cli/** + # proposals live only on GH as pure markdown + - !docs/proposals/** + # docs scripts & tools from `make docs` + - hack/check-mkdocs.sh + - hack/check-env-doc.sh + - mkdocs.yml + - .spelling + ui: + - ui/** + tests: name: Unit Tests runs-on: ubuntu-latest @@ -59,7 +130,8 @@ jobs: e2e-tests: name: E2E Tests - needs: [ argoexec-image ] + needs: [ changed-files, argoexec-image ] + if: needs.changed-files.outputs.e2e-tests runs-on: ubuntu-latest timeout-minutes: 30 env: @@ -200,7 +272,8 @@ jobs: codegen: name: Codegen - needs: [ tests ] + needs: [ changed-files, tests ] + if: needs.changed-files.outputs.codegen runs-on: ubuntu-latest timeout-minutes: 20 env: @@ -236,7 +309,8 @@ jobs: lint: name: Lint - needs: [ tests, codegen ] + needs: [ changed-files, tests, codegen ] + if: needs.changed-files.outputs.docs runs-on: ubuntu-latest timeout-minutes: 15 # must be strictly greater than the timeout in .golancgi.yml env: @@ -254,6 +328,8 @@ jobs: ui: name: UI + needs: [ changed-files ] + if: needs.changed-files.outputs.ui runs-on: ubuntu-latest timeout-minutes: 6 env: From aafd917219721c87963aafe887a68466c2ad1509 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 12:38:24 -0400 Subject: [PATCH 02/23] try checking `== 'true'`? - also tiny renames Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 0cce6db59396..d65985b4ca95 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -18,7 +18,7 @@ permissions: jobs: changed-files: - name: Check changed files + name: Get changed files outputs: # reference: https://github.com/tj-actions/changed-files#outputs- all: ${{ steps.changed-files.outputs.all_any_modified == 'true' }} @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 50 # assume PRs are less than 50 commits - - name: Check if relevant files were changed per group + - name: Get relevant files changed per group id: changed-files uses: tj-actions/changed-files@v39 with: @@ -131,7 +131,7 @@ jobs: e2e-tests: name: E2E Tests needs: [ changed-files, argoexec-image ] - if: needs.changed-files.outputs.e2e-tests + if: ${{ needs.changed-files.outputs.e2e-tests== 'true' }} runs-on: ubuntu-latest timeout-minutes: 30 env: @@ -273,7 +273,7 @@ jobs: codegen: name: Codegen needs: [ changed-files, tests ] - if: needs.changed-files.outputs.codegen + if: ${{ needs.changed-files.outputs.codegen == 'true' }} runs-on: ubuntu-latest timeout-minutes: 20 env: @@ -310,7 +310,7 @@ jobs: lint: name: Lint needs: [ changed-files, tests, codegen ] - if: needs.changed-files.outputs.docs + if: ${{ needs.changed-files.outputs.docs == 'true' }} runs-on: ubuntu-latest timeout-minutes: 15 # must be strictly greater than the timeout in .golancgi.yml env: @@ -329,7 +329,7 @@ jobs: ui: name: UI needs: [ changed-files ] - if: needs.changed-files.outputs.ui + if: ${{ needs.changed-files.outputs.ui == 'true' }} runs-on: ubuntu-latest timeout-minutes: 6 env: From 2b36c202015ac829658aae51438a82a89933200c Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 13:12:54 -0400 Subject: [PATCH 03/23] add workaround for status checks Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index d65985b4ca95..2ecd91ba7acc 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -131,7 +131,7 @@ jobs: e2e-tests: name: E2E Tests needs: [ changed-files, argoexec-image ] - if: ${{ needs.changed-files.outputs.e2e-tests== 'true' }} + if: ${{ needs.changed-files.outputs.e2e-tests == 'true' }} runs-on: ubuntu-latest timeout-minutes: 30 env: @@ -270,6 +270,24 @@ jobs: if: ${{ failure() }} run: kubectl logs -c wait -l workflows.argoproj.io/workflow --prefix + # workaround for status checks -- check this one job instead of each individual E2E job in the matrix + # this allows us to skip the entire matrix when it doesn't need to run while still having accurate status checks + # see https://github.com/orgs/community/discussions/9141#discussioncomment-2296809 and https://github.com/orgs/community/discussions/26822#discussioncomment-3305794 + e2e-tests-composite-result: + name: E2E Tests - Composite result + needs: [ e2e-tests ] + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - run: | + result="${{ needs.e2e-tests.result }}" + # mark as successful even if skipped + if [[ $result == "success" || $result == "skipped" ]]; then + exit 0 + else + exit 1 + fi + codegen: name: Codegen needs: [ changed-files, tests ] From 21682cf2cdea021635a795f843550c1d7b15de9f Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 13:28:22 -0400 Subject: [PATCH 04/23] skip unit tests as well Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 2ecd91ba7acc..d1eee61a73da 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -22,6 +22,7 @@ jobs: outputs: # reference: https://github.com/tj-actions/changed-files#outputs- all: ${{ steps.changed-files.outputs.all_any_modified == 'true' }} + tests: ${{ steps.changed-files.outputs.tests_any_modified == 'true' }} e2e-tests: ${{ steps.changed-files.outputs.e2e-tests_any_modified == 'true' }} codegen: ${{ steps.changed-files.outputs.codegen_any_modified == 'true' }} docs: ${{ steps.changed-files.outputs.docs_any_modified == 'true' }} @@ -38,18 +39,30 @@ jobs: files: | all: - .github/workflows/ci-build.yaml + tests: + - cmd/** + - config/** + - errors/** + - persist/** + - pkg/** + - server/** + - test/** + - util/** + - workflow/** e2e-tests: + # same as tests above - cmd/** - config/** - errors/** - - manifests/** - persist/** - pkg/** - - sdks/** - server/** - test/** - util/** - workflow/** + # plus manifests and SDKs that are used in E2E tests + - manifests/** + - sdks/** codegen: # generated files - api/** @@ -90,6 +103,8 @@ jobs: tests: name: Unit Tests + needs: [ changed-files ] + if: ${{ needs.changed-files.outputs.tests == 'true' }} runs-on: ubuntu-latest timeout-minutes: 10 steps: From 9dce4cb5b6ebb8cd33e679943b0d44615488fbeb Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 13:42:28 -0400 Subject: [PATCH 05/23] add some more relevant files to the lists Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index d1eee61a73da..b5ce332d8044 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -49,6 +49,8 @@ jobs: - test/** - util/** - workflow/** + - go.mod + - go.sum e2e-tests: # same as tests above - cmd/** @@ -60,6 +62,8 @@ jobs: - test/** - util/** - workflow/** + - go.mod + - go.sum # plus manifests and SDKs that are used in E2E tests - manifests/** - sdks/** @@ -72,8 +76,10 @@ jobs: - pkg/** - sdks/java/** - sdks/python/** - # examples are used within the fields lists - - examples/** + # files that generation is based off + - pkg/** + - cmd/** + - examples/** # examples are used within the fields lists # generation scripts - hack/cli/** - hack/jsonschema/** From d278e8b037fb806c68977686c6c52c52fae9cb0d Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 13:46:18 -0400 Subject: [PATCH 06/23] full lint checks Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index b5ce332d8044..d273b34ce80f 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -25,7 +25,7 @@ jobs: tests: ${{ steps.changed-files.outputs.tests_any_modified == 'true' }} e2e-tests: ${{ steps.changed-files.outputs.e2e-tests_any_modified == 'true' }} codegen: ${{ steps.changed-files.outputs.codegen_any_modified == 'true' }} - docs: ${{ steps.changed-files.outputs.docs_any_modified == 'true' }} + lint: ${{ steps.changed-files.outputs.lint_any_modified == 'true' }} ui: ${{ steps.changed-files.outputs.ui_any_modified == 'true' }} runs-on: ubuntu-latest steps: @@ -91,7 +91,22 @@ jobs: - hack/parse_examples.go - hack/swaggify.sh - .clang-format - docs: + lint: + # same as tests above + - cmd/** + - config/** + - errors/** + - persist/** + - pkg/** + - server/** + - test/** + - util/** + - workflow/** + - go.mod + - go.sum + # plus lint config + - .golangci.yml + # docs files below - docs/** # generated files are covered by codegen - !docs/fields.md @@ -102,8 +117,10 @@ jobs: # docs scripts & tools from `make docs` - hack/check-mkdocs.sh - hack/check-env-doc.sh - - mkdocs.yml + - .markdownlint.yaml + - .mlc_config.json - .spelling + - mkdocs.yml ui: - ui/** @@ -349,9 +366,9 @@ jobs: lint: name: Lint needs: [ changed-files, tests, codegen ] - if: ${{ needs.changed-files.outputs.docs == 'true' }} + if: ${{ needs.changed-files.outputs.lint == 'true' }} runs-on: ubuntu-latest - timeout-minutes: 15 # must be strictly greater than the timeout in .golancgi.yml + timeout-minutes: 15 # must be strictly greater than the timeout in .golangci.yml env: GOPATH: /home/runner/go steps: From dbe0b7974f1c6bb8e6406bca56c43077c855d8aa Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 13:50:41 -0400 Subject: [PATCH 07/23] add empty line in UI to test that UI check runs Signed-off-by: Anton Gilgur --- ui/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/.gitignore b/ui/.gitignore index 7b9d1bddd171..2c98b85cd946 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -3,3 +3,4 @@ dist bundle .vscode yarn-error.log + From b17c223c5900025119561830e83c3b345336d4a7 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 13:56:52 -0400 Subject: [PATCH 08/23] fix to use files_yaml? Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index d273b34ce80f..daf24adf01a0 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -36,7 +36,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v39 with: - files: | + files_yaml: | all: - .github/workflows/ci-build.yaml tests: From 4536f54a7a5192ee73a2a853ce04eecaa5fb5835 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 14:03:29 -0400 Subject: [PATCH 09/23] yaml nots need quoting? Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index daf24adf01a0..63ab26d1111f 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -109,11 +109,11 @@ jobs: # docs files below - docs/** # generated files are covered by codegen - - !docs/fields.md - - !docs/executor_swagger.md - - !docs/cli/** + - '!docs/fields.md' + - '!docs/executor_swagger.md' + - '!docs/cli/**' # proposals live only on GH as pure markdown - - !docs/proposals/** + - '!docs/proposals/**' # docs scripts & tools from `make docs` - hack/check-mkdocs.sh - hack/check-env-doc.sh From c6de85334afb165a60530e69aea7f5edade77d33 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 14:24:00 -0400 Subject: [PATCH 10/23] dry up config a bit Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 63ab26d1111f..7d3050d31deb 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -23,9 +23,9 @@ jobs: # reference: https://github.com/tj-actions/changed-files#outputs- all: ${{ steps.changed-files.outputs.all_any_modified == 'true' }} tests: ${{ steps.changed-files.outputs.tests_any_modified == 'true' }} - e2e-tests: ${{ steps.changed-files.outputs.e2e-tests_any_modified == 'true' }} + e2e-tests: ${{ steps.changed-files.outputs.tests_any_modified == 'true' || steps.changed-files.outputs.e2e-tests_any_modified == 'true' }} codegen: ${{ steps.changed-files.outputs.codegen_any_modified == 'true' }} - lint: ${{ steps.changed-files.outputs.lint_any_modified == 'true' }} + lint: ${{ steps.changed-files.outputs.tests_any_modified == 'true' || steps.changed-files.outputs.lint_any_modified == 'true' }} ui: ${{ steps.changed-files.outputs.ui_any_modified == 'true' }} runs-on: ubuntu-latest steps: @@ -52,18 +52,7 @@ jobs: - go.mod - go.sum e2e-tests: - # same as tests above - - cmd/** - - config/** - - errors/** - - persist/** - - pkg/** - - server/** - - test/** - - util/** - - workflow/** - - go.mod - - go.sum + # to include tests above in check as well # plus manifests and SDKs that are used in E2E tests - manifests/** - sdks/** @@ -92,18 +81,7 @@ jobs: - hack/swaggify.sh - .clang-format lint: - # same as tests above - - cmd/** - - config/** - - errors/** - - persist/** - - pkg/** - - server/** - - test/** - - util/** - - workflow/** - - go.mod - - go.sum + # to include tests above in check as well # plus lint config - .golangci.yml # docs files below From 3086e7878051561695d492bb2b149133319504ce Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 14:26:10 -0400 Subject: [PATCH 11/23] add empty line to test lint Signed-off-by: Anton Gilgur --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index aa8344c4bf9e..a301e2e3edbe 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -63,3 +63,4 @@ issues: exclude-rules: - path: server/artifacts/artifact_server_test.go text: "response body must be closed" + From 7ebd7d7f617bf4ac5c79d0ca04416575b3acf37a Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 14:45:31 -0400 Subject: [PATCH 12/23] try removing the nots? Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 7d3050d31deb..f6ad56e8344d 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -86,12 +86,6 @@ jobs: - .golangci.yml # docs files below - docs/** - # generated files are covered by codegen - - '!docs/fields.md' - - '!docs/executor_swagger.md' - - '!docs/cli/**' - # proposals live only on GH as pure markdown - - '!docs/proposals/**' # docs scripts & tools from `make docs` - hack/check-mkdocs.sh - hack/check-env-doc.sh From 188b6d44ecd33f772ea6746c9b1cd4bbcbf55a0e Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 14:51:38 -0400 Subject: [PATCH 13/23] change the DRY mechanism? - list merging is not supported in YAML natively, but `changed-files` appears to support it? https://github.com/tj-actions/changed-files/blob/2a10bef1b42044172f2e64d40beeb8fbad792438/test/changed-files.yml#L8-L11 Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index f6ad56e8344d..ee28703bb856 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -23,9 +23,9 @@ jobs: # reference: https://github.com/tj-actions/changed-files#outputs- all: ${{ steps.changed-files.outputs.all_any_modified == 'true' }} tests: ${{ steps.changed-files.outputs.tests_any_modified == 'true' }} - e2e-tests: ${{ steps.changed-files.outputs.tests_any_modified == 'true' || steps.changed-files.outputs.e2e-tests_any_modified == 'true' }} + e2e-tests: ${{ steps.changed-files.outputs.e2e-tests_any_modified == 'true' }} codegen: ${{ steps.changed-files.outputs.codegen_any_modified == 'true' }} - lint: ${{ steps.changed-files.outputs.tests_any_modified == 'true' || steps.changed-files.outputs.lint_any_modified == 'true' }} + lint: ${{ steps.changed-files.outputs.lint_any_modified == 'true' }} ui: ${{ steps.changed-files.outputs.ui_any_modified == 'true' }} runs-on: ubuntu-latest steps: @@ -39,7 +39,7 @@ jobs: files_yaml: | all: - .github/workflows/ci-build.yaml - tests: + tests: &tests - cmd/** - config/** - errors/** @@ -52,7 +52,7 @@ jobs: - go.mod - go.sum e2e-tests: - # to include tests above in check as well + - *tests # plus manifests and SDKs that are used in E2E tests - manifests/** - sdks/** @@ -81,11 +81,17 @@ jobs: - hack/swaggify.sh - .clang-format lint: - # to include tests above in check as well + - *tests # plus lint config - .golangci.yml # docs files below - docs/** + # generated files are covered by codegen + - '!docs/fields.md' + - '!docs/executor_swagger.md' + - '!docs/cli/**' + # proposals live only on GH as pure markdown + - '!docs/proposals/**' # docs scripts & tools from `make docs` - hack/check-mkdocs.sh - hack/check-env-doc.sh From 9aa097e9a98ec41f6c318e506e2e4553985642e8 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:03:01 -0400 Subject: [PATCH 14/23] fix `needs` for `lint` and `codegen` - both can run independently of each other and independently of tests - they should fail fast if the other one fails though, I suppose - otherwise this breaks some of the checks, since if tests are skipped, then codegen and lint are skipped too - or, well, that's my hypothesis at least -- will test by pushing this Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index ee28703bb856..ffb38d54b8d9 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -306,7 +306,7 @@ jobs: codegen: name: Codegen - needs: [ changed-files, tests ] + needs: [ changed-files ] if: ${{ needs.changed-files.outputs.codegen == 'true' }} runs-on: ubuntu-latest timeout-minutes: 20 @@ -343,7 +343,7 @@ jobs: lint: name: Lint - needs: [ changed-files, tests, codegen ] + needs: [ changed-files ] if: ${{ needs.changed-files.outputs.lint == 'true' }} runs-on: ubuntu-latest timeout-minutes: 15 # must be strictly greater than the timeout in .golangci.yml From 6b506ea50a51255a5eac745a8f6f8b041591e44a Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 13:51:32 -0400 Subject: [PATCH 15/23] revert ui test change - so now only lint should run... Signed-off-by: Anton Gilgur --- ui/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/.gitignore b/ui/.gitignore index 2c98b85cd946..7b9d1bddd171 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -3,4 +3,3 @@ dist bundle .vscode yarn-error.log - From 3c7d1277b8afbb9055379177021e1980ec1c444a Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:19:44 -0400 Subject: [PATCH 16/23] revert lint test change Signed-off-by: Anton Gilgur --- .golangci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index a301e2e3edbe..aa8344c4bf9e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -63,4 +63,3 @@ issues: exclude-rules: - path: server/artifacts/artifact_server_test.go text: "response body must be closed" - From 34671d73cb209c08915c51be4bd92af357851ece Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:21:20 -0400 Subject: [PATCH 17/23] add empty line to test Codegen Signed-off-by: Anton Gilgur --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 2f14c8575147..02441b61ea80 100644 --- a/.clang-format +++ b/.clang-format @@ -1,2 +1,2 @@ # Allow unlimited column length, rather than 80. This prevents word-wrapping comments, which end up in Swagger. -ColumnLimit: 0 \ No newline at end of file +ColumnLimit: 0 From c50d621afa7ef792d4af65e22d529c0335209d80 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:27:11 -0400 Subject: [PATCH 18/23] revert codegen test change This reverts commit 34671d73cb209c08915c51be4bd92af357851ece. Signed-off-by: Anton Gilgur --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 02441b61ea80..2f14c8575147 100644 --- a/.clang-format +++ b/.clang-format @@ -1,2 +1,2 @@ # Allow unlimited column length, rather than 80. This prevents word-wrapping comments, which end up in Swagger. -ColumnLimit: 0 +ColumnLimit: 0 \ No newline at end of file From 98e80c1e54da70f1101c0b227711a45c2fa802c4 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:28:35 -0400 Subject: [PATCH 19/23] add empty line to test E2E Signed-off-by: Anton Gilgur --- manifests/base/argo-server/argo-server-deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/base/argo-server/argo-server-deployment.yaml b/manifests/base/argo-server/argo-server-deployment.yaml index e3672fbe16a2..3cd186f4c9e3 100644 --- a/manifests/base/argo-server/argo-server-deployment.yaml +++ b/manifests/base/argo-server/argo-server-deployment.yaml @@ -44,3 +44,4 @@ spec: runAsNonRoot: true nodeSelector: kubernetes.io/os: linux + From e183ca9f91de63df13b3f3eebaed83ec73e8e8ab Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:29:26 -0400 Subject: [PATCH 20/23] revert E2E test change Signed-off-by: Anton Gilgur --- manifests/base/argo-server/argo-server-deployment.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/base/argo-server/argo-server-deployment.yaml b/manifests/base/argo-server/argo-server-deployment.yaml index 3cd186f4c9e3..e3672fbe16a2 100644 --- a/manifests/base/argo-server/argo-server-deployment.yaml +++ b/manifests/base/argo-server/argo-server-deployment.yaml @@ -44,4 +44,3 @@ spec: runAsNonRoot: true nodeSelector: kubernetes.io/os: linux - From 22b9216a2975947b4931679665db0ee7a93579f4 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:32:11 -0400 Subject: [PATCH 21/23] add empty line to test units, e2e, lint Signed-off-by: Anton Gilgur --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index ecdc5f0b4490..8a3e339372e0 100644 --- a/go.mod +++ b/go.mod @@ -283,3 +283,4 @@ replace ( github.com/antonmedv/expr => github.com/expr-lang/expr v0.0.0-20230912141041-709c5dd55aa7 github.com/go-git/go-git/v5 => github.com/argoproj-labs/go-git/v5 v5.4.7 ) + From 3940d44b9da76b74c1b375c365fdcbdd3b000f09 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:39:14 -0400 Subject: [PATCH 22/23] revert unit test et al change Signed-off-by: Anton Gilgur --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index 8a3e339372e0..ecdc5f0b4490 100644 --- a/go.mod +++ b/go.mod @@ -283,4 +283,3 @@ replace ( github.com/antonmedv/expr => github.com/expr-lang/expr v0.0.0-20230912141041-709c5dd55aa7 github.com/go-git/go-git/v5 => github.com/argoproj-labs/go-git/v5 v5.4.7 ) - From a51064cd1ce62bb5f57e54334850ce1a30eae2bf Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 14 Oct 2023 15:40:00 -0400 Subject: [PATCH 23/23] run all jobs when ci-build.yaml is changed Signed-off-by: Anton Gilgur --- .github/workflows/ci-build.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index ffb38d54b8d9..ca37f860a3d9 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -21,7 +21,6 @@ jobs: name: Get changed files outputs: # reference: https://github.com/tj-actions/changed-files#outputs- - all: ${{ steps.changed-files.outputs.all_any_modified == 'true' }} tests: ${{ steps.changed-files.outputs.tests_any_modified == 'true' }} e2e-tests: ${{ steps.changed-files.outputs.e2e-tests_any_modified == 'true' }} codegen: ${{ steps.changed-files.outputs.codegen_any_modified == 'true' }} @@ -37,9 +36,10 @@ jobs: uses: tj-actions/changed-files@v39 with: files_yaml: | - all: + common: &common - .github/workflows/ci-build.yaml tests: &tests + - *common - cmd/** - config/** - errors/** @@ -57,6 +57,7 @@ jobs: - manifests/** - sdks/** codegen: + - *common # generated files - api/** - docs/fields.md @@ -100,6 +101,7 @@ jobs: - .spelling - mkdocs.yml ui: + - *common - ui/** tests: