Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support skip ci in azure pipelines #677

Draft
wants to merge 19 commits into
base: devel
Choose a base branch
from
3 changes: 3 additions & 0 deletions .github/workflows/ci_packages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Packages CI
on: [push, pull_request]




jobs:
build:
if: |
Expand Down
34 changes: 28 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ pr:
include:
- '*'

variables:
SKIP_CI_FILTER: '[skip ci]'



jobs:
- job: packages

Expand Down Expand Up @@ -52,10 +57,27 @@ jobs:
steps:
- bash: git config --global core.autocrlf false
displayName: 'Disable auto conversion to CRLF by git (Windows-only)'
condition: eq(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

- checkout: self
fetchDepth: 1
fetchDepth: 2

- bash: |
# refs https://github.com/microsoft/azure-pipelines-agent/issues/2944
# --no-merges needed to avoid merge commits which occur for PR's.
# $(Build.SourceVersionMessage) isn't helpful
echo "ok1c"
git log -5 --pretty=format:"%s"
echo "ok2"
echo "\nok2b"
git log --no-merges -5 --pretty=format:"%s"
echo
echo "ok3"
commitMsg=$(git log --no-merges -1 --pretty=format:"%s")
echo commitMsg: $commitMsg
echo $commitMsg | grep -v '\[skip ci\]'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
displayName: 'Check whether to skip CI'

- bash: git clone --depth 1 https://github.com/nim-lang/csources
displayName: 'Checkout Nim csources'
Expand All @@ -73,7 +95,7 @@ jobs:
echo_run sudo apt-fast install --no-install-recommends -yq \
libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev valgrind libc6-dbg
displayName: 'Install dependencies (amd64 Linux)'
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64'))
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64'))

- bash: |
set -e
Expand Down Expand Up @@ -113,11 +135,11 @@ jobs:
echo_run chmod 755 bin/g++

displayName: 'Install dependencies (i386 Linux)'
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386'))
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386'))

- bash: brew install boehmgc make sfml
displayName: 'Install dependencies (OSX)'
condition: eq(variables['Agent.OS'], 'Darwin')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))

- bash: |
set -e
Expand All @@ -130,7 +152,7 @@ jobs:
echo_run echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/dist/mingw64/bin'

displayName: 'Install dependencies (Windows)'
condition: eq(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

- bash: echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/bin'
displayName: 'Add build binaries to PATH'
Expand Down
7 changes: 4 additions & 3 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,10 @@ Continuous Integration (CI)

1. Continuous Integration is by default run on every push in a PR; this clogs
the CI pipeline and affects other PR's; if you don't need it (e.g. for WIP or
documentation only changes), add `[ci skip]` to your commit message title.
This convention is supported by `Appveyor
<https://www.appveyor.com/docs/how-to/filtering-commits/#skip-directive-in-commit-message>`_
documentation only changes), add `[skip ci]` to your commit message title.
This convention is supported by our github actions pipelines, as well as other piplines
(now unused in this repository):
`Appveyor <https://www.appveyor.com/docs/how-to/filtering-commits/#skip-directive-in-commit-message>`_
and `Travis <https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build>`_.

2. Consider enabling CI (azure, GitHub actions and builds.sr.ht) in your own Nim fork, and
Expand Down