-
Notifications
You must be signed in to change notification settings - Fork 2.4k
136 lines (129 loc) · 4.6 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on:
push:
branches-ignore: [master]
pull_request:
branches: ['*']
defaults:
run:
shell: bash
jobs:
# Check Code style quickly by running `rustfmt` over all code
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update stable && rustup default stable
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
- run: |
for manifest in `find crates -name Cargo.toml`
do
echo check fmt for $manifest
cargo fmt --all --manifest-path $manifest -- --check
done
test:
runs-on: ${{ matrix.os }}
env:
CARGO_PROFILE_DEV_DEBUG: 1
CARGO_PROFILE_TEST_DEBUG: 1
CARGO_INCREMENTAL: 0
strategy:
matrix:
include:
- os: ubuntu-latest
rust: stable
other: i686-unknown-linux-gnu
- os: ubuntu-latest
rust: beta
other: i686-unknown-linux-gnu
- os: ubuntu-latest
rust: nightly
other: i686-unknown-linux-gnu
- os: macos-latest
rust: stable
other: x86_64-apple-ios
- os: windows-latest
rust: stable-msvc
other: i686-pc-windows-msvc
- os: windows-latest
rust: nightly-gnu
other: i686-pc-windows-gnu
steps:
- uses: actions/checkout@v2
- name: Update Rustup (temporary workaround)
run: rustup self update
shell: bash
if: startsWith(matrix.os, 'windows')
- run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: rustup target add ${{ matrix.other }}
- run: rustup component add rustc-dev llvm-tools-preview rust-docs
if: startsWith(matrix.rust, 'nightly')
- run: sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y
if: matrix.os == 'ubuntu-latest'
- run: rustup component add rustfmt || echo "rustfmt not available"
# Deny warnings on CI to avoid warnings getting into the codebase.
- run: cargo test --features 'deny-warnings'
- run: cargo test --features 'deny-warnings' -p cargo-test-support
- run: cargo test -p cargo-platform
- run: cargo test -p cargo-util
- run: cargo test --manifest-path crates/mdman/Cargo.toml
- run: cargo build --manifest-path crates/credential/cargo-credential-1password/Cargo.toml
- run: cargo build --manifest-path crates/credential/cargo-credential-gnome-secret/Cargo.toml
if: matrix.os == 'ubuntu-latest'
- run: cargo build --manifest-path crates/credential/cargo-credential-macos-keychain/Cargo.toml
if: matrix.os == 'macos-latest'
- run: cargo build --manifest-path crates/credential/cargo-credential-wincred/Cargo.toml
if: matrix.os == 'windows-latest'
- name: Fetch smoke test
run: ci/fetch-smoke-test.sh
resolver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update stable && rustup default stable
- run: cargo test --manifest-path crates/resolver-tests/Cargo.toml
build_std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly && rustup default nightly
- run: rustup component add rust-src
- run: cargo build
- run: cargo test --test build-std
env:
CARGO_RUN_BUILD_STD_TESTS: 1
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly && rustup default nightly
- run: rustup component add rust-docs
- run: ci/validate-man.sh
# This requires rustfmt, use stable.
- run: cd src/doc/semver-check && cargo +stable run
- run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- run: cargo doc --no-deps
- run: cd src/doc && mdbook build --dest-dir ../../target/doc
- run: |
cd src/doc
curl -sSLo linkcheck.sh \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
sh linkcheck.sh --all cargo
success:
name: bors build finished
needs: [docs, rustfmt, test, resolver, build_std]
runs-on: ubuntu-latest
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
steps:
- run: echo ok
failure:
name: bors build finished
needs: [docs, rustfmt, test, resolver, build_std]
runs-on: ubuntu-latest
if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
steps:
- run: exit 1