From d4a37ff9c26b931b5963be9a6dc093a2d820199a Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 12 Nov 2023 20:14:52 +0900 Subject: [PATCH] ci: split workflows (#17242) --- .github/workflows/test-all.yaml | 43 ----------------- .github/workflows/test.yaml | 47 ++++++------------- .github/workflows/wc-check-files.yaml | 10 ++++ .github/workflows/wc-generate-registry.yaml | 14 ++++++ .github/workflows/wc-json-schema.yaml | 10 ++++ .github/workflows/wc-prettier.yaml | 11 +++++ .../wc-renovate-config-validator.yaml | 8 ++++ .github/workflows/wc-test-docker.yaml | 16 +++++++ 8 files changed, 84 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/test-all.yaml create mode 100644 .github/workflows/wc-check-files.yaml create mode 100644 .github/workflows/wc-generate-registry.yaml create mode 100644 .github/workflows/wc-json-schema.yaml create mode 100644 .github/workflows/wc-prettier.yaml create mode 100644 .github/workflows/wc-renovate-config-validator.yaml create mode 100644 .github/workflows/wc-test-docker.yaml diff --git a/.github/workflows/test-all.yaml b/.github/workflows/test-all.yaml deleted file mode 100644 index d0f754db5f9..00000000000 --- a/.github/workflows/test-all.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -name: test all packages -on: workflow_dispatch - -permissions: {} -env: - AQUA_LOG_COLOR: always -jobs: - test: - strategy: - matrix: - env: - - runs-on: windows-latest - - runs-on: ubuntu-latest - - runs-on: macos-latest - - runs-on: ubuntu-latest - goarch: arm64 - - runs-on: macos-latest - goos: darwin - goarch: arm64 - - runs-on: windows-latest - goarch: arm64 - runs-on: ${{ matrix.env.runs-on }} - defaults: - run: - shell: bash - env: - AQUA_CONFIG: aqua-all.yaml - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Generate token - id: generate_token - uses: tibdex/github-app-token@32691ba7c9e7063bd457bd8f2a5703138591fa58 # v1 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - - uses: aquaproj/aqua-installer@928a2ee4243a9ee8312d80dc8cbaca88fb602a91 # v2.2.0 - with: - aqua_version: v2.16.4 - aqua_opts: "" - policy_allow: "true" - env: - AQUA_GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a4935b41f89..8d0c5bc8b60 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,19 +24,24 @@ jobs: filters: | renovate-config-validator: - renovate.json5 + - .github/workflows/wc-renovate-config-validator.yaml check-files: - pkgs/**/pkg.yaml - pkgs/**/registry.yaml + - .github/workflows/wc-check-files.yaml generate-registry: - aqua/generate-registry.yaml - registry.yaml - pkgs/**/registry.yaml + - .github/workflows/wc-generate-registry.yaml json-schema: - registry.yaml + - .github/workflows/wc-json-schema.yaml test-docker: - docker/* - scripts/** - cmdx.yaml + - .github/workflows/wc-test-docker.yaml status-check: # This job is used for main branch's branch protection rule's status check. @@ -78,60 +83,38 @@ jobs: renovate-config-validator: # Validate Renovate Configuration by renovate-config-validator. - uses: suzuki-shunsuke/renovate-config-validator-workflow/.github/workflows/validate.yaml@4a378742d05b4e67aae34039d7c779ac913cd79d # v0.2.3 + uses: ./.github/workflows/wc-renovate-config-validator.yaml needs: path-filter if: ${{needs.path-filter.outputs.renovate-config-validator == 'true'}} permissions: contents: read check-files: - runs-on: ubuntu-latest + uses: ./.github/workflows/wc-check-files.yaml needs: path-filter if: ${{needs.path-filter.outputs.check-files == 'true'}} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: aquaproj/registry-action/check-files@dff21577b6ec277b2645a7a40db12eeb15b4c581 # v0.2.0 + permissions: {} generate-registry: - runs-on: ubuntu-latest + uses: ./.github/workflows/wc-generate-registry.yaml needs: path-filter if: ${{needs.path-filter.outputs.generate-registry == 'true'}} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: aquaproj/aqua-installer@928a2ee4243a9ee8312d80dc8cbaca88fb602a91 # v2.2.0 - with: - aqua_version: v2.16.4 - policy_allow: "true" - - uses: aquaproj/registry-action/generate-registry@dff21577b6ec277b2645a7a40db12eeb15b4c581 # v0.2.0 + permissions: {} json-schema: - runs-on: ubuntu-latest + uses: ./.github/workflows/wc-json-schema.yaml needs: path-filter if: ${{needs.path-filter.outputs.json-schema == 'true'}} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: aquaproj/registry-action/validate-json-schema@dff21577b6ec277b2645a7a40db12eeb15b4c581 # v0.2.0 + permissions: {} prettier: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - run: npm i -g prettier - - run: prettier -c . + uses: ./.github/workflows/wc-prettier.yaml + permissions: {} test-docker: - runs-on: ubuntu-latest + uses: ./.github/workflows/wc-test-docker.yaml needs: path-filter if: ${{needs.path-filter.outputs.test-docker == 'true'}} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: aquaproj/aqua-installer@928a2ee4243a9ee8312d80dc8cbaca88fb602a91 # v2.2.0 - with: - aqua_version: v2.16.4 - policy_allow: "true" - env: - AQUA_GITHUB_TOKEN: ${{github.token}} - - run: cmdx t suzuki-shunsuke/mkghtag ci-info: runs-on: ubuntu-latest diff --git a/.github/workflows/wc-check-files.yaml b/.github/workflows/wc-check-files.yaml new file mode 100644 index 00000000000..7d99a4e76fc --- /dev/null +++ b/.github/workflows/wc-check-files.yaml @@ -0,0 +1,10 @@ +--- +name: check-files +on: workflow_call +jobs: + check-files: + runs-on: ubuntu-latest + permissions: {} + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: aquaproj/registry-action/check-files@dff21577b6ec277b2645a7a40db12eeb15b4c581 # v0.2.0 diff --git a/.github/workflows/wc-generate-registry.yaml b/.github/workflows/wc-generate-registry.yaml new file mode 100644 index 00000000000..8d7e4bcf807 --- /dev/null +++ b/.github/workflows/wc-generate-registry.yaml @@ -0,0 +1,14 @@ +--- +name: generate-registry +on: workflow_call +jobs: + generate-registry: + runs-on: ubuntu-latest + permissions: {} + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: aquaproj/aqua-installer@928a2ee4243a9ee8312d80dc8cbaca88fb602a91 # v2.2.0 + with: + aqua_version: v2.16.4 + policy_allow: "true" + - uses: aquaproj/registry-action/generate-registry@dff21577b6ec277b2645a7a40db12eeb15b4c581 # v0.2.0 diff --git a/.github/workflows/wc-json-schema.yaml b/.github/workflows/wc-json-schema.yaml new file mode 100644 index 00000000000..02a5fde2dd7 --- /dev/null +++ b/.github/workflows/wc-json-schema.yaml @@ -0,0 +1,10 @@ +--- +name: json-schema +on: workflow_call +jobs: + json-schema: + runs-on: ubuntu-latest + permissions: {} + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: aquaproj/registry-action/validate-json-schema@dff21577b6ec277b2645a7a40db12eeb15b4c581 # v0.2.0 diff --git a/.github/workflows/wc-prettier.yaml b/.github/workflows/wc-prettier.yaml new file mode 100644 index 00000000000..0e062658250 --- /dev/null +++ b/.github/workflows/wc-prettier.yaml @@ -0,0 +1,11 @@ +--- +name: prettier +on: workflow_call +jobs: + prettier: + runs-on: ubuntu-latest + permissions: {} + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - run: npm i -g prettier + - run: prettier -c . diff --git a/.github/workflows/wc-renovate-config-validator.yaml b/.github/workflows/wc-renovate-config-validator.yaml new file mode 100644 index 00000000000..23b04513de3 --- /dev/null +++ b/.github/workflows/wc-renovate-config-validator.yaml @@ -0,0 +1,8 @@ +--- +name: renovate-config-validator +on: workflow_call +jobs: + renovate-config-validator: + uses: suzuki-shunsuke/renovate-config-validator-workflow/.github/workflows/validate.yaml@4a378742d05b4e67aae34039d7c779ac913cd79d # v0.2.3 + permissions: + contents: read diff --git a/.github/workflows/wc-test-docker.yaml b/.github/workflows/wc-test-docker.yaml new file mode 100644 index 00000000000..6846b15644d --- /dev/null +++ b/.github/workflows/wc-test-docker.yaml @@ -0,0 +1,16 @@ +--- +name: test-docker +on: workflow_call +jobs: + test-docker: + runs-on: ubuntu-latest + permissions: {} + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: aquaproj/aqua-installer@928a2ee4243a9ee8312d80dc8cbaca88fb602a91 # v2.2.0 + with: + aqua_version: v2.16.4 + policy_allow: "true" + env: + AQUA_GITHUB_TOKEN: ${{github.token}} + - run: cmdx t suzuki-shunsuke/mkghtag