Skip to content

Commit 5e2d140

Browse files
committed
Auto merge of #5071 - flip1995:gha, r=<try>
[WIP][DNM] Switch to GitHub Actions cc #4577 This is just an experiment. I don't think we have a consensus _if_ we should move away from travis/appveyor. GHA would let us run up to 20 concurrent jobs. Since we have 15 integration tests and 4 (linux, linux 32-bit, macos, windows) basic tests, we would be able to run everything concurrently. ~~Also IIUC we only have to build Clippy once for every initegration test and then only check the repos.~~ Nope, dependent jobs exist, but they won't keep the artifacts (not even the checkout). TODO before merge: - [ ] Add `DEPLOY_KEY` secret to github repo - [ ] test deployment on test branch `gh-test` - [ ] talk with `@rust-lang/infra` for bors - [ ] Add GHA badge to Cargo.toml (blocked on rust-lang/crates.io#1838) - [ ] Add back travis + appveyor files for transition period (?) changelog: none
2 parents eff3bc5 + 8d1e233 commit 5e2d140

24 files changed

+724
-506
lines changed

.github/deploy.sh

-81
This file was deleted.

.github/deploy_key.enc

-1.64 KB
Binary file not shown.

.github/workflows/clippy.yml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Clippy Test
2+
3+
on:
4+
push:
5+
# Ignore bors branches, since they are covered by `clippy_bors.yml`
6+
branches-ignore: [auto, try]
7+
# Don't run Clippy tests, when only textfiles were modified
8+
paths-ignore:
9+
- 'COPYRIGHT'
10+
- 'LICENSE-*'
11+
- '**.md'
12+
- '**.txt'
13+
pull_request:
14+
# Don't run Clippy tests, when only textfiles were modified
15+
paths-ignore:
16+
- 'COPYRIGHT'
17+
- 'LICENSE-*'
18+
- '**.md'
19+
- '**.txt'
20+
21+
env:
22+
RUST_BACKTRACE: 1
23+
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
24+
GHA_CI: 1
25+
26+
jobs:
27+
base:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
32+
with:
33+
github_token: "${{ secrets.github_token }}"
34+
- name: rust-toolchain
35+
uses: actions-rs/[email protected]
36+
with:
37+
toolchain: nightly
38+
target: x86_64-unknown-linux-gnu
39+
profile: minimal
40+
- name: Cache cargo dir
41+
uses: actions/cache@v1
42+
with:
43+
path: ~/.cargo
44+
key: ${{ runner.os }}-x86_64-unknown-linux-gnu
45+
- name: Checkout
46+
uses: actions/[email protected]
47+
- name: Master Toolchain Setup
48+
run: bash setup-toolchain.sh
49+
50+
- name: Set LD_LIBRARY_PATH (Linux)
51+
run: |
52+
SYSROOT=$(rustc --print sysroot)
53+
echo "::set-env name=LD_LIBRARY_PATH::${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}"
54+
- name: Build
55+
run: cargo build --features deny-warnings
56+
- name: Test
57+
run: cargo test --features deny-warnings
58+
- name: Test clippy_lints
59+
run: cargo test --features deny-warnings
60+
working-directory: clippy_lints
61+
- name: Test rustc_tools_util
62+
run: cargo test --features deny-warnings
63+
working-directory: rustc_tools_util
64+
- name: Test clippy_dev
65+
run: cargo test --features deny-warnings
66+
working-directory: clippy_dev
67+
- name: Test cargo-clippy
68+
run: ../target/debug/cargo-clippy
69+
working-directory: clippy_workspace_tests
70+
- name: Test clippy-driver
71+
run: |
72+
(
73+
set -ex
74+
# Check sysroot handling
75+
sysroot=$(./target/debug/clippy-driver --print sysroot)
76+
test "$sysroot" = "$(rustc --print sysroot)"
77+
78+
desired_sysroot=/tmp
79+
sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
80+
test "$sysroot" = $desired_sysroot
81+
82+
sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
83+
test "$sysroot" = $desired_sysroot
84+
85+
# Make sure this isn't set - clippy-driver should cope without it
86+
unset CARGO_MANIFEST_DIR
87+
88+
# Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
89+
# FIXME: How to match the clippy invocation in compile-test.rs?
90+
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr && exit 1
91+
sed -e 's,tests/ui,$DIR,' -e '/= help/d' cstring.stderr > normalized.stderr
92+
diff normalized.stderr tests/ui/cstring.stderr
93+
94+
# TODO: CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR
95+
)
96+
97+
- name: Run cargo-cache --autoclean
98+
run: |
99+
cargo install cargo-cache --debug
100+
find ~/.cargo/bin ! -type d -exec strip {} \;
101+
cargo cache --autoclean

0 commit comments

Comments
 (0)