Remove azure and rename gh actions (#409)
* Remove azure * Rename actions * Rename workflow * Reduce amount of actions * Fix patch
This commit is contained in:
parent
40103d84ce
commit
7e35b758be
|
@ -1,9 +1,13 @@
|
|||
name: continuous integration
|
||||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request: {}
|
||||
|
||||
jobs:
|
||||
build_whole_workspace:
|
||||
test-workspace:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
|
@ -34,7 +38,7 @@ jobs:
|
|||
command: test
|
||||
args: --verbose
|
||||
|
||||
build_per_crate:
|
||||
test:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
@ -76,7 +80,7 @@ jobs:
|
|||
mv Cargo.toml Cargo.toml.bck
|
||||
sed -n '/\[patch.crates-io\]/q;p' Cargo.toml.bck > Cargo.toml
|
||||
# Patch all crates
|
||||
cat ci/patch.toml >> Cargo.toml
|
||||
cat .github/workflows/patch.toml >> Cargo.toml
|
||||
# Print `Cargo.toml` for debugging
|
||||
echo "~~~~ Cargo.toml ~~~~"
|
||||
cat Cargo.toml
|
||||
|
@ -95,7 +99,7 @@ jobs:
|
|||
command: test
|
||||
args: -p ${{ matrix.crate }} --verbose
|
||||
|
||||
rustfmt_check:
|
||||
rustfmt:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
trigger: ["master"]
|
||||
pr: ["master"]
|
||||
|
||||
jobs:
|
||||
- template: ci/azure-rustfmt.yml
|
||||
parameters:
|
||||
name: rustfmt
|
||||
|
||||
# Basic test run on all platforms
|
||||
- template: ci/azure-test-stable.yml
|
||||
parameters:
|
||||
name: Linux_Stable
|
||||
displayName: Test
|
||||
vmImage: ubuntu-16.04
|
||||
crates:
|
||||
- tower-balance
|
||||
- tower-buffer
|
||||
- tower-discover
|
||||
- tower-filter
|
||||
- tower-hedge
|
||||
- tower-layer
|
||||
- tower-limit
|
||||
- tower-load
|
||||
- tower-load-shed
|
||||
- tower-reconnect
|
||||
- tower-retry
|
||||
- tower-service
|
||||
- tower-make
|
||||
- tower-spawn-ready
|
||||
- tower-test
|
||||
- tower-timeout
|
||||
- tower-util
|
||||
- tower
|
||||
|
||||
- template: ci/azure-deploy-docs.yml
|
||||
parameters:
|
||||
dependsOn:
|
||||
- rustfmt
|
||||
- Linux_Stable
|
|
@ -1,39 +0,0 @@
|
|||
parameters:
|
||||
dependsOn: []
|
||||
|
||||
jobs:
|
||||
- job: documentation
|
||||
displayName: 'Deploy API Documentation'
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
dependsOn:
|
||||
- ${{ parameters.dependsOn }}
|
||||
steps:
|
||||
- template: azure-install-rust.yml
|
||||
parameters:
|
||||
platform: ${{parameters.name}}
|
||||
rust: nightly
|
||||
- script: |
|
||||
cargo doc --all --no-deps
|
||||
cp -R target/doc '$(Build.BinariesDirectory)'
|
||||
displayName: 'Generate Documentation'
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
git --version
|
||||
ls -la
|
||||
git init
|
||||
git config user.name 'Deployment Bot (from Azure Pipelines)'
|
||||
git config user.email 'deploy@tower-rs.com'
|
||||
git config --global credential.helper 'store --file ~/.my-credentials'
|
||||
printf "protocol=https\nhost=github.com\nusername=carllerche\npassword=%s\n\n" "$GITHUB_TOKEN" | git credential-store --file ~/.my-credentials store
|
||||
git remote add origin https://github.com/tower-rs/tower
|
||||
git checkout -b gh-pages
|
||||
git add .
|
||||
git commit -m 'Deploy Tower API documentation'
|
||||
git push -f origin gh-pages
|
||||
env:
|
||||
GITHUB_TOKEN: $(githubPersonalToken)
|
||||
workingDirectory: '$(Build.BinariesDirectory)'
|
||||
displayName: 'Deploy Documentation'
|
|
@ -1,53 +0,0 @@
|
|||
# https://github.com/crate-ci/azure-pipelines/blob/master/azure/install-rust.yml
|
||||
# defaults for any parameters that aren't specified
|
||||
parameters:
|
||||
rust: stable
|
||||
components: []
|
||||
targets: []
|
||||
|
||||
steps:
|
||||
# Linux and macOS.
|
||||
- script: |
|
||||
set -e
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
|
||||
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: ${{parameters.rust}}
|
||||
displayName: "Install rust (*nix)"
|
||||
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
|
||||
|
||||
# Windows.
|
||||
- script: |
|
||||
curl -sSf -o rustup-init.exe https://win.rustup.rs
|
||||
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
|
||||
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
||||
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: ${{parameters.rust}}
|
||||
displayName: "Install rust (windows)"
|
||||
condition: eq(variables['Agent.OS'], 'Windows_NT')
|
||||
|
||||
# Set correct toolchain
|
||||
- bash: |
|
||||
rustup default $RUSTUP_TOOLCHAIN
|
||||
rustup update $RUSTUP_TOOLCHAIN
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: ${{parameters.rust}}
|
||||
displayName: "Set correct Rust version"
|
||||
|
||||
# Install additional targets:
|
||||
- ${{ each target in parameters.targets }}:
|
||||
- script: rustup target add ${{ target }}
|
||||
displayName: "Adding target '${{ target }}'"
|
||||
|
||||
# Install additional components:
|
||||
- ${{ each component in parameters.components }}:
|
||||
- script: rustup component add ${{ component }}
|
||||
displayName: "Adding component '${{ component }}'"
|
||||
|
||||
# See what we got
|
||||
- script: |
|
||||
rustc --version
|
||||
cargo --version
|
||||
rustup --version
|
||||
displayName: Check installed rust version
|
|
@ -1,9 +0,0 @@
|
|||
steps:
|
||||
- bash: |
|
||||
set -e
|
||||
|
||||
if git log --no-merges -1 --format='%B' | grep -qF '[ci-release]'; then
|
||||
echo "##vso[task.setvariable variable=isRelease]true"
|
||||
fi
|
||||
failOnStderr: true
|
||||
displayName: Check if release commit
|
|
@ -1,17 +0,0 @@
|
|||
steps:
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
# Remove any existing patch statements
|
||||
mv Cargo.toml Cargo.toml.bck
|
||||
sed -n '/\[patch.crates-io\]/q;p' Cargo.toml.bck > Cargo.toml
|
||||
|
||||
# Patch all crates
|
||||
cat ci/patch.toml >> Cargo.toml
|
||||
|
||||
# Print `Cargo.toml` for debugging
|
||||
echo "~~~~ Cargo.toml ~~~~"
|
||||
cat Cargo.toml
|
||||
echo "~~~~~~~~~~~~~~~~~~~~"
|
||||
displayName: Patch Cargo.toml
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
jobs:
|
||||
# Check formatting
|
||||
- job: ${{ parameters.name }}
|
||||
displayName: Check rustfmt
|
||||
pool:
|
||||
vmImage: ubuntu-16.04
|
||||
steps:
|
||||
- template: azure-install-rust.yml
|
||||
parameters:
|
||||
rust: stable
|
||||
components:
|
||||
- rustfmt
|
||||
- bash: |
|
||||
cargo fmt --all -- --check
|
||||
displayName: Check formatting
|
|
@ -1,33 +0,0 @@
|
|||
parameters:
|
||||
crates: []
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.name }}
|
||||
displayName: ${{ parameters.displayName }}
|
||||
pool:
|
||||
vmImage: ${{ parameters.vmImage }}
|
||||
steps:
|
||||
- template: azure-install-rust.yml
|
||||
parameters:
|
||||
rust: stable
|
||||
|
||||
- template: azure-is-release.yml
|
||||
|
||||
- ${{ each crate in parameters.crates }}:
|
||||
- script: cargo test
|
||||
env:
|
||||
CI: 'True'
|
||||
RUSTFLAGS: '-D warnings'
|
||||
displayName: cargo test -p ${{ crate }}
|
||||
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}
|
||||
condition: and(succeeded(), ne(variables['isRelease'], 'true'))
|
||||
|
||||
- template: azure-patch-crates.yml
|
||||
|
||||
- ${{ each crate in parameters.crates }}:
|
||||
- script: cargo test
|
||||
env:
|
||||
CI: 'True'
|
||||
RUSTFLAGS: '-D warnings'
|
||||
displayName: cargo test -p ${{ crate }}
|
||||
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}
|
Loading…
Reference in New Issue