-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Switch to GitHub Actions - Part 2 - From within #5088
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
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
2f8ef89
Add integration test GitHub action
flip1995 1158c18
Add clippy_dev checks to GitHub Actions
flip1995 20c3319
Add remark check to GHA
flip1995 2a7a3aa
Rename .remarkrc.json -> .remarkrc and fix file
flip1995 757bbf7
Fix markdown Files
flip1995 d14ee8a
Add Clippy Test (bors) to GHA
flip1995 1717a6f
Ignore fmt test in GHA CI
flip1995 ff8336b
Check if changelog exists
flip1995 f5db351
Get {RUSTUP,MULTIRUST}_{HOME,TOOLCHAIN} from runtime environment
flip1995 66b5e22
Add Clippy Test to GHA
flip1995 9281167
Move integration tests in clippy_bors.yml
flip1995 893e261
Add deployment to GHA
flip1995 8f45387
Small change to comment in .gitignore
flip1995 d7620a3
Add GHA badge to README.md
flip1995 b9580fc
Cancle builds on new commits
flip1995 e59361f
Limit parallel jobs on try/r+ runs
flip1995 935b94d
Sort output of export.py script
flip1995 ea780a6
Extract driver test
flip1995 dfdea56
Extract deployment
flip1995 ab43951
Allow non-ascii characters in changelog check
flip1995 1ceeb13
Build Clippy before running integration tests
flip1995 095287d
Add two more error causes to integration test
flip1995 813d319
Use hash of Cargo.lock file in cache name
flip1995 b8b47ab
Add bors dummy jobs
flip1995 abb095d
Run bors checks unconditionally
flip1995 b47dada
Apply review comments
flip1995 622ece3
Remove deployment from travis
flip1995 2745346
Install all required remark packages in travis
flip1995 a0a21a8
Use nightly cargo to install cargo-cache
flip1995 3fac289
Don't upload target/release in integration_build
flip1995 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
# Check sysroot handling | ||
sysroot=$(./target/debug/clippy-driver --print sysroot) | ||
test "$sysroot" = "$(rustc --print sysroot)" | ||
|
||
if [[ ${OS} == "Windows" ]]; then | ||
desired_sysroot=C:/tmp | ||
else | ||
desired_sysroot=/tmp | ||
fi | ||
sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot) | ||
test "$sysroot" = $desired_sysroot | ||
|
||
sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot) | ||
test "$sysroot" = $desired_sysroot | ||
|
||
# Make sure this isn't set - clippy-driver should cope without it | ||
unset CARGO_MANIFEST_DIR | ||
|
||
# Run a lint and make sure it produces the expected output. It's also expected to exit with code 1 | ||
# FIXME: How to match the clippy invocation in compile-test.rs? | ||
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr && exit 1 | ||
sed -e "s,tests/ui,\$DIR," -e "/= help/d" cstring.stderr > normalized.stderr | ||
diff normalized.stderr tests/ui/cstring.stderr | ||
|
||
# TODO: CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Clippy Test | ||
|
||
on: | ||
push: | ||
# Ignore bors branches, since they are covered by `clippy_bors.yml` | ||
branches-ignore: [auto, try] | ||
# Don't run Clippy tests, when only textfiles were modified | ||
paths-ignore: | ||
- 'COPYRIGHT' | ||
- 'LICENSE-*' | ||
- '**.md' | ||
- '**.txt' | ||
pull_request: | ||
# Don't run Clippy tests, when only textfiles were modified | ||
paths-ignore: | ||
- 'COPYRIGHT' | ||
- 'LICENSE-*' | ||
- '**.md' | ||
- '**.txt' | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TARGET_DIR: '${{ github.workspace }}/target' | ||
NO_FMT_TEST: 1 | ||
|
||
jobs: | ||
base: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Setup | ||
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master | ||
with: | ||
github_token: "${{ secrets.github_token }}" | ||
|
||
- name: rust-toolchain | ||
uses: actions-rs/toolchain@v1.0.3 | ||
with: | ||
toolchain: nightly | ||
target: x86_64-unknown-linux-gnu | ||
profile: minimal | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2.0.0 | ||
|
||
- name: Run cargo update | ||
run: cargo update | ||
|
||
- name: Cache cargo dir | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo | ||
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-x86_64-unknown-linux-gnu | ||
|
||
- name: Master Toolchain Setup | ||
run: bash setup-toolchain.sh | ||
|
||
# Run | ||
- name: Set LD_LIBRARY_PATH (Linux) | ||
run: | | ||
SYSROOT=$(rustc --print sysroot) | ||
echo "::set-env name=LD_LIBRARY_PATH::${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" | ||
flip1995 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Build | ||
run: cargo build --features deny-warnings | ||
|
||
- name: Test | ||
run: cargo test --features deny-warnings | ||
|
||
- name: Test clippy_lints | ||
run: cargo test --features deny-warnings | ||
working-directory: clippy_lints | ||
|
||
- name: Test rustc_tools_util | ||
run: cargo test --features deny-warnings | ||
working-directory: rustc_tools_util | ||
|
||
- name: Test clippy_dev | ||
run: cargo test --features deny-warnings | ||
working-directory: clippy_dev | ||
|
||
- name: Test cargo-clippy | ||
run: ../target/debug/cargo-clippy | ||
working-directory: clippy_workspace_tests | ||
|
||
- name: Test clippy-driver | ||
run: bash .github/driver.sh | ||
env: | ||
OS: ${{ runner.os }} | ||
|
||
# Cleanup | ||
- name: Run cargo-cache --autoclean | ||
run: | | ||
cargo +nightly install cargo-cache --debug | ||
find ~/.cargo/bin ! -type d -exec strip {} \; | ||
cargo cache --autoclean |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.