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

set up cargo-deny #89

Merged
merged 8 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 35 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,17 @@ executors:
xcode: 11.4
rust_windows: &rust_windows_executor
machine:
image: 'windows-server-2019-vs2019:stable'
image: "windows-server-2019-vs2019:stable"
resource_class: windows.xlarge
shell: powershell.exe -ExecutionPolicy Bypass

jobs:
build_test_lint:
build_test_lint_check:
parameters:
platform:
type: executor
executor: << parameters.platform >>
environment:
# Note: This is a no-op at the second, but bear with me on this. If this
# comment is not removed by 2021-06-30 remove it along with the next line.
# renovate: datasource=github-tags depName=nodejs/node versioning=node
NODE_VERSION: 14.17.5
NPM_VERSION: 7.10.0
steps:
Expand All @@ -42,14 +39,15 @@ jobs:
command: git submodule update --recursive --init
- when:
condition:
equal: [ *rust_macos_executor, << parameters.platform >> ]
equal: [*rust_macos_executor, << parameters.platform >>]
steps:
- run: echo "HOMEBREW_NO_AUTO_UPDATE=1" >> $BASH_ENV
- run: echo "export OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1" >> $BASH_ENV
- run: test -e "$OPENSSL_ROOT_DIR"
- run: brew install cmake
- rust/install:
version: stable
- run: cargo install --locked cargo-deny
- restore_cache:
keys:
- rust-target-v1-macos-{{ checksum "Cargo.lock" }}
Expand Down Expand Up @@ -80,7 +78,7 @@ jobs:
- target/
- when:
condition:
equal: [ *rust_linux_executor, << parameters.platform >> ]
equal: [*rust_linux_executor, << parameters.platform >>]
steps:
- run:
name: Update and install dependencies
Expand All @@ -89,6 +87,7 @@ jobs:
sudo apt-get install -y libssl-dev cmake
- rust/install:
version: stable
- run: cargo install --locked cargo-deny
- restore_cache:
keys:
- rust-target-v1-linux-{{ checksum "Cargo.lock" }}
Expand Down Expand Up @@ -118,18 +117,18 @@ jobs:
- target/
- when:
condition:
equal: [ *rust_windows_executor, << parameters.platform >> ]
equal: [*rust_windows_executor, << parameters.platform >>]
steps:
# - run:
# # TODO compiling grpcio on Windows is still not working
# # using boringssl gives an error message
# # using openssl hangs indefinitely
# name: Install grpcio build dependencies
# command: |
# choco install activeperl -y
# choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System'
# choco install yasm -y
# choco install openssl -y
# - run:
# # TODO compiling grpcio on Windows is still not working
# # using boringssl gives an error message
# # using openssl hangs indefinitely
# name: Install grpcio build dependencies
# command: |
# choco install activeperl -y
# choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System'
# choco install yasm -y
# choco install openssl -y
- run:
name: Install rustup
environment:
Expand All @@ -150,6 +149,8 @@ jobs:
[net]
git-fetch-with-cli = true
"@
$env:CARGO_NET_GIT_FETCH_WITH_CLI='true'
- run: cargo install --locked cargo-deny
- restore_cache:
keys:
- rust-target-v1-windows-{{ checksum "Cargo.lock" }}
Expand Down Expand Up @@ -206,23 +207,27 @@ jobs:
- run:
name: wait for federation demo to start
command: npx wait-on tcp:4001 tcp:4002 tcp:4003 tcp:4004 tcp:4100

- when:
condition:
not:
equal: [*rust_windows_executor, << parameters.platform >>]
steps:
- run:
command: >
cargo xtask check
- run:
command: >
cargo xtask test --with-demo
cargo xtask lint
- run:
command: >
cargo xtask lint
cargo xtask test --with-demo

build_release:
parameters:
platform:
type: executor
executor: << parameters.platform >>
environment:
# Note: This is a no-op at the second, but bear with me on this. If this
# comment is not removed by 2021-06-30 remove it along with the next line.
# renovate: datasource=github-tags depName=nodejs/node versioning=node
NODE_VERSION: 14.17.5
NPM_VERSION: 7.10.0
RELEASE_BIN: router
Expand All @@ -236,7 +241,7 @@ jobs:
command: git submodule update --recursive --init
- when:
condition:
equal: [ *rust_macos_executor, << parameters.platform >> ]
equal: [*rust_macos_executor, << parameters.platform >>]
steps:
- run: echo "HOMEBREW_NO_AUTO_UPDATE=1" >> $BASH_ENV
- run: echo "export OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1" >> $BASH_ENV
Expand Down Expand Up @@ -280,7 +285,7 @@ jobs:
--output artifacts/
- when:
condition:
equal: [ *rust_linux_executor, << parameters.platform >> ]
equal: [*rust_linux_executor, << parameters.platform >>]
steps:
- run:
name: Update and install dependencies
Expand Down Expand Up @@ -316,7 +321,7 @@ jobs:
cargo xtask package --output artifacts/
- when:
condition:
equal: [ *rust_windows_executor, << parameters.platform >> ]
equal: [*rust_windows_executor, << parameters.platform >>]
steps:
- run:
name: Install rustup
Expand Down Expand Up @@ -409,7 +414,7 @@ jobs:
workflows:
build:
jobs:
- build_test_lint:
- build_test_lint_check:
matrix:
parameters:
platform: [rust_macos, rust_windows, rust_linux]
Expand All @@ -423,11 +428,11 @@ workflows:
branches:
ignore: /.*/
tags:
only : /v.*/
only: /v.*/
- publish_github_release:
requires: [build_release]
filters:
branches:
ignore: /.*/
tags:
only : /v.*/
only: /v.*/
Loading