2019-07-17 19:05:07 +03:00
|
|
|
version: 1
|
|
|
|
policy:
|
|
|
|
pullRequests: public
|
|
|
|
tasks:
|
|
|
|
$let:
|
|
|
|
user: ${event.sender.login}
|
|
|
|
|
|
|
|
head_branch:
|
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: ${event.pull_request.head.ref}
|
|
|
|
else:
|
|
|
|
$if: 'tasks_for == "github-push"'
|
|
|
|
then: ${event.ref}
|
|
|
|
else: ${event.release.target_commitish}
|
|
|
|
|
|
|
|
head_rev:
|
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: ${event.pull_request.head.sha}
|
|
|
|
else:
|
|
|
|
$if: 'tasks_for == "github-push"'
|
|
|
|
then: ${event.after}
|
|
|
|
else: ${event.release.tag_name}
|
|
|
|
|
|
|
|
repository:
|
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: ${event.pull_request.head.repo.html_url}
|
|
|
|
else: ${event.repository.html_url}
|
|
|
|
in:
|
2020-04-07 19:41:19 +03:00
|
|
|
$if: 'tasks_for == "github-push" || (tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"])'
|
2019-07-17 19:05:07 +03:00
|
|
|
then:
|
|
|
|
- taskId: {$eval: as_slugid("lint_test_task")}
|
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '1 hour'}
|
2019-11-05 20:50:33 +03:00
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: ci
|
2019-07-17 19:05:07 +03:00
|
|
|
payload:
|
|
|
|
maxRunTime: 3600
|
|
|
|
image: "rust:buster"
|
|
|
|
command:
|
|
|
|
- "/bin/bash"
|
2019-08-05 15:28:08 +03:00
|
|
|
- "-cx"
|
2019-08-05 15:00:46 +03:00
|
|
|
- "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py &&
|
2020-06-26 16:51:12 +03:00
|
|
|
rustup component add clippy rustfmt &&
|
2019-08-05 15:47:13 +03:00
|
|
|
git clone --recursive --quiet ${repository} &&
|
2019-07-17 19:05:07 +03:00
|
|
|
cd rust-code-analysis &&
|
|
|
|
git -c advice.detachedHead=false checkout ${head_rev} &&
|
|
|
|
pip3 install --quiet pre-commit &&
|
2020-02-26 17:03:52 +03:00
|
|
|
pre-commit run -a --show-diff-on-failure &&
|
2020-06-01 13:29:42 +03:00
|
|
|
cargo test --all --verbose --all-features"
|
2019-07-17 19:05:07 +03:00
|
|
|
metadata:
|
|
|
|
name: rust-code-analysis lint and test
|
|
|
|
description: rust-code-analysis lint and test
|
2019-10-01 14:32:23 +03:00
|
|
|
owner: cdenizet@mozilla.com
|
2020-04-03 20:04:34 +03:00
|
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
|
|
|
|
2020-06-22 17:12:39 +03:00
|
|
|
- taskId: {$eval: as_slugid("build_documentation")}
|
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '2 hour'}
|
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: ci
|
|
|
|
payload:
|
|
|
|
maxRunTime: 3600
|
|
|
|
image: "rust:buster"
|
|
|
|
command:
|
|
|
|
- "/bin/bash"
|
|
|
|
- "-cx"
|
|
|
|
- "git clone --recursive --quiet ${repository} &&
|
|
|
|
cd rust-code-analysis &&
|
|
|
|
git -c advice.detachedHead=false checkout ${head_rev} &&
|
|
|
|
cargo install mdbook --no-default-features --features search,output --vers \"^0.1.0\" &&
|
|
|
|
cargo doc --release &&
|
|
|
|
cd rust-code-analysis-book &&
|
|
|
|
mdbook build &&
|
|
|
|
tar -zvcf /book.tar.gz book/"
|
|
|
|
artifacts:
|
|
|
|
public/book.tar.gz:
|
|
|
|
expires: {$fromNow: '2 weeks'}
|
|
|
|
path: /book.tar.gz
|
|
|
|
type: file
|
|
|
|
metadata:
|
|
|
|
name: rust-code-analysis documentation
|
|
|
|
description: rust-code-analysis build documentation
|
|
|
|
owner: cdenizet@mozilla.com
|
|
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
|
|
|
|
2020-05-11 17:27:55 +03:00
|
|
|
- taskId: {$eval: as_slugid("ccov_test_task")}
|
2020-04-03 20:04:34 +03:00
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '1 hour'}
|
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: ci
|
|
|
|
payload:
|
|
|
|
maxRunTime: 3600
|
2020-06-26 16:51:12 +03:00
|
|
|
image: "rustlang/rust:nightly"
|
2020-04-03 20:04:34 +03:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: 4df01912-087e-489a-be28-25aa911cb9d2
|
|
|
|
CARGO_INCREMENTAL: 0
|
2020-05-28 12:12:50 +03:00
|
|
|
RUSTFLAGS: -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort
|
|
|
|
RUSTDOCFLAGS: -Cpanic=abort
|
2020-04-03 20:04:34 +03:00
|
|
|
command:
|
|
|
|
- "/bin/bash"
|
|
|
|
- "-cx"
|
|
|
|
- "apt-get -qq update &&
|
|
|
|
apt-get -qq install -y zip &&
|
|
|
|
curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-linux-x86_64.tar.bz2 | tar jxf - &&
|
|
|
|
git clone --recursive --quiet ${repository} &&
|
|
|
|
cd rust-code-analysis &&
|
|
|
|
git -c advice.detachedHead=false checkout ${head_rev} &&
|
2020-06-01 13:29:42 +03:00
|
|
|
cargo test --all --verbose --all-features &&
|
2020-04-03 20:04:34 +03:00
|
|
|
zip -0 ccov.zip `find . -name 'rust_code_analysis*.gc*' -print` &&
|
|
|
|
../grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore '/*' -o lcov.info &&
|
|
|
|
bash <(curl -s https://codecov.io/bash) -f lcov.info"
|
|
|
|
metadata:
|
|
|
|
name: rust-code-analysis grcov test
|
|
|
|
description: rust-code-analysis grcov test
|
|
|
|
owner: cdenizet@mozilla.com
|
2019-07-17 19:05:07 +03:00
|
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
2019-12-19 17:02:45 +03:00
|
|
|
|
2020-03-30 12:37:59 +03:00
|
|
|
- taskId: {$eval: as_slugid("windows_test_task")}
|
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '1 hour'}
|
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: win2012r2
|
|
|
|
payload:
|
|
|
|
maxRunTime: 3600
|
|
|
|
command:
|
2020-05-06 13:51:19 +03:00
|
|
|
- set VSWHERE=%programfiles(x86)%\Microsoft Visual Studio\Installer
|
|
|
|
- set VS_BINS=VC\Tools\MSVC\*\bin\Hostx64\x64
|
2020-03-30 12:37:59 +03:00
|
|
|
- set RUSTUP_INIT_PATH=%CD%\rustup-init
|
2020-05-06 13:51:19 +03:00
|
|
|
- set CARGO_PATH=%USERPROFILE%\.cargo\bin
|
|
|
|
- set PATH=%RUSTUP_INIT_PATH%;%CARGO_PATH%;%VSWHERE%;%PATH%
|
|
|
|
- set VSWHERE_CMD=vswhere -latest -products * -find %VS_BINS%
|
|
|
|
- FOR /F "tokens=*" %%o IN ('%VSWHERE_CMD%') do (SET LIB_PATH=%%o)
|
|
|
|
- set PATH=%LIB_PATH%;%PATH%
|
2020-03-30 12:37:59 +03:00
|
|
|
- rustup-init -yv --default-toolchain stable ^
|
|
|
|
--default-host x86_64-pc-windows-msvc
|
|
|
|
- git clone --recursive --quiet ${repository}
|
|
|
|
- cd rust-code-analysis
|
|
|
|
- git -c advice.detachedHead=false checkout ${head_rev}
|
2020-06-01 13:29:42 +03:00
|
|
|
- cargo test --all --verbose --all-features
|
2020-03-30 12:37:59 +03:00
|
|
|
mounts:
|
|
|
|
- content:
|
|
|
|
url: https://win.rustup.rs/
|
|
|
|
file: rustup-init\rustup-init.exe
|
|
|
|
metadata:
|
|
|
|
name: rust-code-analysis windows test
|
|
|
|
description: rust-code-analysis windows test
|
|
|
|
owner: cdenizet@mozilla.com
|
|
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
|
|
|
|
2019-12-19 17:02:45 +03:00
|
|
|
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
|
|
|
|
then:
|
2020-05-10 13:48:49 +03:00
|
|
|
taskId: {$eval: as_slugid("build_linux_release")}
|
2019-12-19 17:02:45 +03:00
|
|
|
dependencies:
|
|
|
|
- {$eval: as_slugid("lint_test_task")}
|
2020-03-30 12:37:59 +03:00
|
|
|
- {$eval: as_slugid("windows_test_task")}
|
2019-12-19 17:02:45 +03:00
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '2 hour'}
|
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: ci
|
|
|
|
payload:
|
|
|
|
maxRunTime: 3600
|
|
|
|
image: "rust:buster"
|
|
|
|
command:
|
|
|
|
- "/bin/bash"
|
|
|
|
- "-cx"
|
|
|
|
- "git clone --recursive --quiet ${repository} &&
|
|
|
|
cd rust-code-analysis &&
|
|
|
|
git -c advice.detachedHead=false checkout ${head_rev} &&
|
2020-05-10 13:48:49 +03:00
|
|
|
cargo build --all --release &&
|
2019-12-19 17:02:45 +03:00
|
|
|
cd target/release &&
|
2020-05-10 13:48:49 +03:00
|
|
|
strip rust-code-analysis-cli &&
|
|
|
|
tar -zvcf /build.tar.gz \
|
|
|
|
--transform 's,^,rust-code-analysis-linux-x86_64/,' \
|
|
|
|
rust-code-analysis-cli"
|
2019-12-19 17:02:45 +03:00
|
|
|
artifacts:
|
|
|
|
public/rust-code-analysis-linux-x86_64.tar.gz:
|
|
|
|
expires: {$fromNow: '2 weeks'}
|
|
|
|
path: /build.tar.gz
|
|
|
|
type: file
|
|
|
|
metadata:
|
2020-05-10 13:48:49 +03:00
|
|
|
name: rust-code-analysis linux release build
|
|
|
|
description: rust-code-analysis linux release build
|
|
|
|
owner: cdenizet@mozilla.com
|
|
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
|
|
|
|
|
|
|
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
|
|
|
|
then:
|
|
|
|
taskId: {$eval: as_slugid("build_windows_release")}
|
|
|
|
dependencies:
|
|
|
|
- {$eval: as_slugid("lint_test_task")}
|
|
|
|
- {$eval: as_slugid("windows_test_task")}
|
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '2 hour'}
|
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: win2012r2
|
|
|
|
payload:
|
|
|
|
maxRunTime: 3600
|
|
|
|
command:
|
|
|
|
- set VSWHERE=%programfiles(x86)%\Microsoft Visual Studio\Installer
|
|
|
|
- set VS_BINS=VC\Tools\MSVC\*\bin\Hostx64\x64
|
|
|
|
- set RUSTUP_INIT_PATH=%CD%\rustup-init
|
|
|
|
- set CARGO_PATH=%USERPROFILE%\.cargo\bin
|
|
|
|
- set PATH=%RUSTUP_INIT_PATH%;%CARGO_PATH%;%VSWHERE%;%PATH%
|
|
|
|
- set VSWHERE_CMD=vswhere -latest -products * -find %VS_BINS%
|
|
|
|
- FOR /F "tokens=*" %%o IN ('%VSWHERE_CMD%') do (SET LIB_PATH=%%o)
|
|
|
|
- set PATH=%LIB_PATH%;%PATH%
|
|
|
|
- rustup-init -yv --default-toolchain stable ^
|
|
|
|
--default-host x86_64-pc-windows-msvc
|
|
|
|
- git clone --recursive --quiet ${repository}
|
|
|
|
- cd rust-code-analysis
|
|
|
|
- git -c advice.detachedHead=false checkout ${head_rev}
|
|
|
|
- cargo build --all --release
|
|
|
|
mounts:
|
|
|
|
- content:
|
|
|
|
url: https://win.rustup.rs/
|
|
|
|
file: rustup-init\rustup-init.exe
|
|
|
|
artifacts:
|
|
|
|
- name: public/rust-code-analysis-cli.exe
|
|
|
|
expires: {$fromNow: '2 weeks'}
|
|
|
|
path: rust-code-analysis\target\release\rust-code-analysis-cli.exe
|
|
|
|
type: file
|
|
|
|
metadata:
|
|
|
|
name: rust-code-analysis windows release build
|
|
|
|
description: rust-code-analysis windows release build
|
|
|
|
owner: cdenizet@mozilla.com
|
|
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
|
|
|
|
|
|
|
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
|
|
|
|
then:
|
|
|
|
taskId: {$eval: as_slugid("strip_windows_binary")}
|
|
|
|
dependencies:
|
|
|
|
- {$eval: as_slugid("build_windows_release")}
|
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '2 hour'}
|
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: ci
|
|
|
|
payload:
|
|
|
|
maxRunTime: 3600
|
2020-06-23 12:52:21 +03:00
|
|
|
image: "mozilla/taskboot:0.2.7"
|
2020-05-10 13:48:49 +03:00
|
|
|
env:
|
|
|
|
WINDOWS_BIN: rust-code-analysis-cli.exe
|
|
|
|
command:
|
|
|
|
- "/bin/sh"
|
|
|
|
- "-cx"
|
|
|
|
- "taskboot retrieve-artifact --output-path=. \
|
2020-06-23 12:52:21 +03:00
|
|
|
--artifacts=public/$WINDOWS_BIN &&
|
2020-05-10 13:48:49 +03:00
|
|
|
apk add --no-cache zip &&
|
|
|
|
strip $WINDOWS_BIN &&
|
2020-05-11 19:28:56 +03:00
|
|
|
zip -9 /rust-code-analysis-win-x86_64.zip $WINDOWS_BIN"
|
2020-05-10 13:48:49 +03:00
|
|
|
artifacts:
|
2020-05-11 17:27:55 +03:00
|
|
|
public/rust-code-analysis-win-x86_64.zip:
|
2020-05-10 13:48:49 +03:00
|
|
|
expires: {$fromNow: '2 weeks'}
|
2020-05-11 17:27:55 +03:00
|
|
|
path: /rust-code-analysis-win-x86_64.zip
|
2020-05-10 13:48:49 +03:00
|
|
|
type: file
|
|
|
|
metadata:
|
|
|
|
name: strip rust-code-analysis windows binary
|
|
|
|
description: strip rust-code-analysis windows binary
|
2019-12-19 17:02:45 +03:00
|
|
|
owner: cdenizet@mozilla.com
|
|
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
|
|
|
|
|
|
|
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
|
|
|
|
then:
|
|
|
|
$let:
|
|
|
|
version: {$eval: 'head_branch[10:]'}
|
2020-05-11 17:27:55 +03:00
|
|
|
linux_artifact: rust-code-analysis-linux-x86_64.tar.gz
|
|
|
|
windows_artifact: rust-code-analysis-win-x86_64.zip
|
2019-12-19 17:02:45 +03:00
|
|
|
in:
|
|
|
|
taskId: {$eval: as_slugid("deploy_release")}
|
|
|
|
dependencies:
|
2020-05-10 13:48:49 +03:00
|
|
|
- {$eval: as_slugid("build_linux_release")}
|
|
|
|
- {$eval: as_slugid("strip_windows_binary")}
|
2020-06-22 17:12:39 +03:00
|
|
|
- {$eval: as_slugid("build_documentation")}
|
2019-12-19 17:02:45 +03:00
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '2 hour'}
|
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: ci
|
|
|
|
scopes:
|
|
|
|
- secrets:get:project/relman/rust-code-analysis/deploy
|
|
|
|
payload:
|
|
|
|
features:
|
|
|
|
taskclusterProxy: true
|
|
|
|
maxRunTime: 3600
|
2020-06-22 17:12:39 +03:00
|
|
|
image: "mozilla/taskboot:0.2.7"
|
2019-12-19 17:02:45 +03:00
|
|
|
env:
|
|
|
|
TASKCLUSTER_SECRET: project/relman/rust-code-analysis/deploy
|
|
|
|
command:
|
2020-05-15 22:40:02 +03:00
|
|
|
- "/bin/sh"
|
|
|
|
- "-cx"
|
2020-06-22 17:12:39 +03:00
|
|
|
- "git config --global user.email moz-tools-bot@moz.tools &&
|
|
|
|
git config --global user.name moz.tools Bot &&
|
|
|
|
git clone --recursive --quiet ${repository} &&
|
|
|
|
cd rust-code-analysis &&
|
|
|
|
taskboot retrieve-artifact --output-path=. \
|
|
|
|
--artifacts=public/book.tar.gz &&
|
|
|
|
tar xfz book.tar.gz -C rust-code-analysis-book &&
|
|
|
|
./rust-code-analysis-book/deploy-to-GitHub-Pages &&
|
|
|
|
taskboot git-push --force-push \
|
|
|
|
github.com/mozilla/rust-code-analysis \
|
|
|
|
moz-tools-bot \
|
|
|
|
gh-pages &&
|
2020-06-23 12:52:42 +03:00
|
|
|
taskboot github-release mozilla/rust-code-analysis ${version} --asset ${linux_artifact}:public/${linux_artifact} ${windows_artifact}:public/${windows_artifact} &&
|
|
|
|
taskboot cargo-publish"
|
2019-12-19 17:02:45 +03:00
|
|
|
metadata:
|
|
|
|
name: "rust-code-analysis release publication ${version}"
|
|
|
|
description: rust-code-analysis release publication on Github
|
|
|
|
owner: cdenizet@mozilla.com
|
|
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|