From c11c99a5b5b6bb6495edf30a3fe347798755575f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 1 Nov 2024 10:29:44 +0900 Subject: [PATCH] Extract the condition to skip --- .github/workflows/compilers.yml | 134 ++++++++------------------------ 1 file changed, 33 insertions(+), 101 deletions(-) diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 785ed5a8d8..8e6203a268 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -29,8 +29,8 @@ permissions: # Each job is split so that they roughly take 30min to run through. jobs: - compile1: - name: 'omnibus compilations, #1' + compile-if: + name: 'omnibus condition' runs-on: ubuntu-latest if: >- ${{!(false @@ -41,6 +41,15 @@ jobs: || contains(github.event.pull_request.labels.*.name, 'Documentation') || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') )}} + steps: + - run: true + working-directory: + + compile1: + name: 'omnibus compilations, #1' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -64,15 +73,8 @@ jobs: compile2: name: 'omnibus compilations, #2' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -89,15 +91,8 @@ jobs: compile3: name: 'omnibus compilations, #3' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -116,15 +111,8 @@ jobs: compile4: name: 'omnibus compilations, #4' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -142,15 +130,8 @@ jobs: compile5: name: 'omnibus compilations, #5' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -177,15 +158,8 @@ jobs: compile6: name: 'omnibus compilations, #6' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -202,15 +176,8 @@ jobs: compile7: name: 'omnibus compilations, #7' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -228,15 +195,8 @@ jobs: compile8: name: 'omnibus compilations, #8' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -256,15 +216,8 @@ jobs: compile9: name: 'omnibus compilations, #9' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -283,15 +236,8 @@ jobs: compileX: name: 'omnibus compilations, #10' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -309,15 +255,8 @@ jobs: compileB: name: 'omnibus compilations, #11' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -335,15 +274,8 @@ jobs: compileC: name: 'omnibus compilations, #12' runs-on: ubuntu-latest - if: >- - ${{!(false - || contains(github.event.head_commit.message, '[DOC]') - || contains(github.event.head_commit.message, 'Document') - || contains(github.event.pull_request.title, '[DOC]') - || contains(github.event.pull_request.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0