rust-code-analysis/.taskcluster.yml

308 строки
13 KiB
YAML
Исходник Обычный вид История

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'}
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 &&
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 &&
pre-commit run -a --show-diff-on-failure &&
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
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- 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
- taskId: {$eval: as_slugid("ccov_test_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: proj-relman
workerType: ci
payload:
maxRunTime: 3600
image: "rustlang/rust:nightly"
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
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} &&
cargo test --all --verbose --all-features &&
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
- taskId: {$eval: as_slugid("windows_test_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 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 test --all --verbose --all-features
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
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: {$eval: as_slugid("build_linux_release")}
dependencies:
- {$eval: as_slugid("lint_test_task")}
- {$eval: as_slugid("windows_test_task")}
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 build --all --release &&
cd target/release &&
strip rust-code-analysis-cli &&
tar -zvcf /build.tar.gz \
--transform 's,^,rust-code-analysis-linux-x86_64/,' \
rust-code-analysis-cli"
artifacts:
public/rust-code-analysis-linux-x86_64.tar.gz:
expires: {$fromNow: '2 weeks'}
path: /build.tar.gz
type: file
metadata:
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"
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 &&
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"
artifacts:
public/rust-code-analysis-win-x86_64.zip:
expires: {$fromNow: '2 weeks'}
path: /rust-code-analysis-win-x86_64.zip
type: file
metadata:
name: strip rust-code-analysis windows binary
description: strip rust-code-analysis windows binary
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:]'}
linux_artifact: rust-code-analysis-linux-x86_64.tar.gz
windows_artifact: rust-code-analysis-win-x86_64.zip
in:
taskId: {$eval: as_slugid("deploy_release")}
dependencies:
- {$eval: as_slugid("build_linux_release")}
- {$eval: as_slugid("strip_windows_binary")}
- {$eval: as_slugid("build_documentation")}
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
image: "mozilla/taskboot:0.2.7"
env:
TASKCLUSTER_SECRET: project/relman/rust-code-analysis/deploy
command:
- "/bin/sh"
- "-cx"
- "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 &&
taskboot github-release mozilla/rust-code-analysis ${version} --asset ${linux_artifact}:public/${linux_artifact} ${windows_artifact}:public/${windows_artifact} &&
taskboot cargo-publish"
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