| ##################################### |
| ## READ BEFORE CHANGING THIS ## |
| ##################################### |
| |
| # We're in the process of evaluating GitHub Actions as a possible replacement |
| # for Azure Pipelines, and at the moment the configuration is duplicated |
| # between the two CI providers. Be sure to also change the configuration in |
| # src/ci/github-actions when changing this file. |
| |
| ##################################### |
| |
| # FIXME(linux): need to configure core dumps, enable them, and then dump |
| # backtraces on failure from all core dumps: |
| # |
| # - bash: sudo apt install gdb |
| # - bash: sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern' |
| # |
| # Check travis config for `gdb --batch` command to print all crash logs |
| |
| steps: |
| |
| # Configure our CI_JOB_NAME variable which log analyzers can use for the main |
| # step to see what's going on. |
| - bash: | |
| builder=$(echo $AGENT_JOBNAME | cut -d ' ' -f 2) |
| echo "##vso[task.setvariable variable=CI_JOB_NAME]$builder" |
| displayName: Configure Job Name |
| |
| # Disable automatic line ending conversion, which is enabled by default on |
| # Azure's Windows image. Having the conversion enabled caused regressions both |
| # in our test suite (it broke miri tests) and in the ecosystem, since we |
| # started shipping install scripts with CRLF endings instead of the old LF. |
| # |
| # Note that we do this a couple times during the build as the PATH and current |
| # user/directory change, e.g. when mingw is enabled. |
| - bash: git config --global core.autocrlf false |
| displayName: "Disable git automatic line ending conversion" |
| |
| - checkout: self |
| fetchDepth: 2 |
| |
| - bash: src/ci/scripts/setup-environment.sh |
| displayName: Setup environment |
| |
| - bash: src/ci/scripts/clean-disk.sh |
| displayName: Clean disk |
| |
| - bash: src/ci/scripts/should-skip-this.sh |
| displayName: Decide whether to run this job |
| |
| - bash: src/ci/scripts/collect-cpu-stats.sh |
| displayName: Collect CPU-usage statistics in the background |
| |
| - bash: src/ci/scripts/dump-environment.sh |
| displayName: Show the current environment |
| |
| - bash: src/ci/scripts/install-sccache.sh |
| displayName: Install sccache |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/install-clang.sh |
| displayName: Install clang |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/install-wix.sh |
| displayName: Install wix |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/symlink-build-dir.sh |
| displayName: Ensure the build happens on a partition with enough space |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/disable-git-crlf-conversion.sh |
| displayName: "Disable git automatic line ending conversion (on C:/)" |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/install-msys2.sh |
| displayName: Install msys2 |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/install-mingw.sh |
| displayName: Install MinGW |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/install-ninja.sh |
| displayName: Install ninja |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/enable-docker-ipv6.sh |
| displayName: Enable IPv6 on Docker |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| # Disable automatic line ending conversion (again). On Windows, when we're |
| # installing dependencies, something switches the git configuration directory or |
| # re-enables autocrlf. We've not tracked down the exact cause -- and there may |
| # be multiple -- but this should ensure submodules are checked out with the |
| # appropriate line endings. |
| - bash: src/ci/scripts/disable-git-crlf-conversion.sh |
| displayName: Disable git automatic line ending conversion |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/checkout-submodules.sh |
| displayName: Checkout submodules |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| - bash: src/ci/scripts/verify-line-endings.sh |
| displayName: Verify line endings |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| |
| # Ensure the `aws` CLI is installed so we can deploy later on, cache docker |
| # images, etc. |
| - bash: src/ci/scripts/install-awscli.sh |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| displayName: Install awscli |
| |
| - bash: src/ci/scripts/run-build-from-ci.sh |
| timeoutInMinutes: 600 |
| env: |
| AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY_ID) |
| AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY) |
| TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN) |
| condition: and(succeeded(), not(variables.SKIP_JOB)) |
| displayName: Run build |
| |
| - bash: src/ci/scripts/upload-artifacts.sh |
| env: |
| AWS_ACCESS_KEY_ID: $(UPLOAD_AWS_ACCESS_KEY_ID) |
| AWS_SECRET_ACCESS_KEY: $(UPLOAD_AWS_SECRET_ACCESS_KEY) |
| displayName: Upload artifacts |
| # Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy |
| # builders *should* have the AWS credentials available. Still, explicitly |
| # adding the condition is helpful as this way CI will not silently skip |
| # deploying artifacts from a dist builder if the variables are misconfigured, |
| # erroring about invalid credentials instead. |
| condition: | |
| and( |
| succeeded(), not(variables.SKIP_JOB), |
| or( |
| variables.UPLOAD_AWS_SECRET_ACCESS_KEY, |
| eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1') |
| ) |
| ) |