Change:
This issue is meant to track where on Travis we currently whenever the commit message looks like it updates a submodule. We should enable something similar for Azure Pipelines where whenever a PR is detected as updating a submodule (either via actually looking at the git history or at the git commit message) then we schedule the builder on the PR. The purpose of this PR build is to help weed out errors even sooner than before where we're just running a smoke tests on Linux on each PR.

Discussion:
mingw-check: IMAGE: mingw-check <del> # TODO: enable this job if the commit message matches this regex, need tools # figure out how to get the current commit message on azure and stick it in a # condition somewhere #     if: commit_message =~ /(?i:^update.*b(rls|rustfmt|clippy|miri|cargo)b)/ # - job: Linux-x86_64-gnu-tools #   pool: #     vmImage: ubuntu-16.04 #   steps: #     - template: steps/run.yml #   variables: #     IMAGE: x86_64-gnu-tools </del> <ins> - job: LinuxTools pool: vmImage: ubuntu-16.04 steps: - template: steps/run.yml parameters: only_on_updated_submodules: 'yes' variables: IMAGE: x86_64-gnu-tools </ins>

# # Check travis config for `gdb --batch` command to print all crash logs <ins> parameters: # When this parameter is set to anything other than an empty string the tests # will only be executed when the commit updates submodules only_on_updated_submodules: '' </ins> steps: # Disable automatic line ending conversion, which is enabled by default on

- checkout: self fetchDepth: 2 <ins> # Set the SKIP_JOB environment variable if this job is supposed to only run # when submodules are updated and they were not. The following time consuming # tasks will be skipped when the environment variable is present. - ${{ if parameters.only_on_updated_submodules }}: - bash: | set -e # Submodules pseudo-files inside git have the 160000 permissions, so when # those files are present in the diff a submodule was updated. if git diff HEAD^ | grep "^index .* 160000" >/dev/null 2>&1; then echo "Executing the job since submodules are updated" else echo "Not executing this job since no submodules were updated" echo "##vso[task.setvariable variable=SKIP_JOB;]1" fi displayName: Decide whether to run this job </ins> # Spawn a background process to collect CPU usage statistics which we'll upload # at the end of the build. See the comments in the script here for more # information.

echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json sudo service docker restart displayName: Enable IPv6 <del> condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Linux')) </ins> # Check out all our submodules, but more quickly than using git by using one of # our custom scripts

set -e mkdir -p $HOME/rustsrc $BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc <del> condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), ne(variables['Agent.OS'], 'Windows_NT')) </ins> displayName: Check out submodules (Unix) - script: | if not exist D:cacherustsrcNUL mkdir D:cacherustsrc sh src/ci/init_repo.sh . /d/cache/rustsrc <del> condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Windows_NT')) </ins> displayName: Check out submodules (Windows) # Ensure the `aws` CLI is installed so we can deploy later on, cache docker

retry pip3 install awscli --upgrade --user echo "##vso[task.prependpath]$HOME/.local/bin" displayName: Install awscli (Linux) <del> condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Linux')) </ins> - script: pip install awscli displayName: Install awscli (non-Linux) <del> condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), ne(variables['Agent.OS'], 'Linux')) </ins> # Configure our CI_JOB_NAME variable which log analyzers can use for the main # step to see what's going on.

python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" "" cd .. rm -rf rust-toolstate <del> condition: and(succeeded(), eq(variables['IMAGE'], 'mingw-check')) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['IMAGE'], 'mingw-check')) </ins> displayName: Verify the publish_toolstate script works - bash: |

SRC: . AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN) <ins> condition: and(succeeded(), not(variables.SKIP_JOB)) </ins> displayName: Run build # If we're a deploy builder, use the `aws` command to publish everything to our

retry aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION env: AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) <del> condition: and(succeeded(), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1'))) </del> <ins> condition: and(succeeded(), not(variables.SKIP_JOB), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1'))) </ins> displayName: Upload artifacts # Upload CPU usage statistics that we've been gathering this whole time. Always