From 34167d58bbfd16d74948d96512ed2e6eb6db2eb2 Mon Sep 17 00:00:00 2001 From: "G. Allais" Date: Wed, 21 Jul 2021 16:49:32 +0100 Subject: [PATCH] [ ci ] controlling builds via commit messages (#1766) --- .github/workflows/ci-idris2.yml | 66 +++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/.github/workflows/ci-idris2.yml b/.github/workflows/ci-idris2.yml index 1591d76f3..442c21370 100644 --- a/.github/workflows/ci-idris2.yml +++ b/.github/workflows/ci-idris2.yml @@ -6,16 +6,56 @@ on: - '*' tags: - '*' + paths-ignore: + - 'docs/**' + - 'icons/**' + - '*.md' + - 'CONTRIBUTORS' + - 'LICENSE' + - '.github/workflows/ci-lint.yml' + - '.github/workflows/ci-sphinx.yml' + - '.github/workflows/ci-super-linter.yml' pull_request: branches: - master - main + paths-ignore: + - 'docs/**' + - 'icons/**' + - '*.md' + - 'CONTRIBUTORS' + - 'LICENSE' + - '.github/workflows/ci-lint.yml' + - '.github/workflows/ci-sphinx.yml' + - '.github/workflows/ci-super-linter.yml' env: IDRIS2_VERSION: 0.4.0 # For previous-version build jobs: + initialise: + runs-on: ubuntu-latest + steps: + - name: Checkout Project + uses: actions/checkout@v2 + with: + # for pull_request so we can do HEAD^2 + fetch-depth: 2 + + - name: Get commit message + id: get_commit_message + run: | + if [[ '${{ github.event_name }}' == 'push' ]]; then + echo ::set-output name=commit_message::$(git log --format=%B -n 1 HEAD) + elif [[ '${{ github.event_name }}' == 'pull_request' ]]; then + echo ::set-output name=commit_message::$(git log --format=%B -n 1 HEAD^2) + fi + + outputs: + commit_message: + echo "${{ steps.get_commit_message.outputs.commit_message }}" + ###################################################################### # Build from the previous version # We perform this check before all the other ones because: @@ -24,7 +64,10 @@ jobs: ###################################################################### quick-check: + needs: initialise runs-on: ubuntu-latest + if: | + !contains(needs.initialise.outputs.commit_message, '[ci: skip]') env: IDRIS2_CG: chez SCHEME: scheme @@ -79,6 +122,10 @@ jobs: ubuntu-bootstrap-chez: needs: quick-check runs-on: ubuntu-latest + if: | + !contains(needs.initialise.outputs.commit_message, '[ci:') + || contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]') + || contains(needs.initialise.outputs.commit_message, '[ci: chez]') env: IDRIS2_CG: chez SCHEME: scheme @@ -104,6 +151,10 @@ jobs: macos-bootstrap-chez: needs: quick-check runs-on: macos-latest + if: | + !contains(needs.initialise.outputs.commit_message, '[ci:') + || contains(needs.initialise.outputs.commit_message, '[ci: macos]') + || contains(needs.initialise.outputs.commit_message, '[ci: chez]') env: SCHEME: chez steps: @@ -128,6 +179,10 @@ jobs: windows-bootstrap-chez: needs: quick-check runs-on: windows-latest + if: | + !contains(needs.initialise.outputs.commit_message, '[ci:') + || contains(needs.initialise.outputs.commit_message, '[ci: windows]') + || contains(needs.initialise.outputs.commit_message, '[ci: chez]') env: MSYSTEM: MINGW64 MSYS2_PATH_TYPE: inherit @@ -173,6 +228,10 @@ jobs: nix-bootstrap-chez: needs: quick-check runs-on: ubuntu-latest + if: | + !contains(needs.initialise.outputs.commit_message, '[ci:') + || contains(needs.initialise.outputs.commit_message, '[ci: nix]') + || contains(needs.initialise.outputs.commit_message, '[ci: chez]') steps: - uses: actions/checkout@v2 with: @@ -187,6 +246,10 @@ jobs: ubuntu-bootstrap-racket: needs: quick-check runs-on: ubuntu-latest + if: | + !contains(needs.initialise.outputs.commit_message, '[ci:') + || contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]') + || contains(needs.initialise.outputs.commit_message, '[ci: racket]') env: IDRIS2_CG: racket steps: @@ -292,6 +355,9 @@ jobs: ubuntu-self-host-previous-version: needs: quick-check runs-on: ubuntu-latest + if: | + !contains(needs.initialise.outputs.commit_message, '[ci:') + || contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]') env: IDRIS2_CG: chez steps: