run: |
MESSAGE=$(git log --format=%B -n 1)
PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
- output=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
- python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
- grep "^changelog: " | \
- sed "s/changelog: //g")
- if [[ -z "$output" ]]; then
+ body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
+ python -c "import sys, json; print(json.load(sys.stdin)['body'])")
+ output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
echo "ERROR: PR body must contain 'changelog: ...'"
exit 1
- elif [[ "$output" = "none" ]]; then
+ }
+ if [[ "$output" = "none" ]]; then
echo "WARNING: changelog is 'none'"
+ else
+ echo "changelog: $output"
fi
env:
PYTHONIOENCODING: 'utf-8'
runs-on: ${{ matrix.os }}
+ # NOTE: If you modify this job, make sure you copy the changes to clippy.yml
steps:
# Setup
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
echo "$SYSROOT/bin" >> $GITHUB_PATH
- name: Build
- run: cargo build --features deny-warnings,internal-lints
+ run: cargo build --features deny-warnings,internal-lints,metadata-collector-lint
- - name: Test Workspace
- run: cargo test --all --features deny-warnings,internal-lints
+ - name: Test
+ run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
+
+ - name: Test clippy_lints
+ run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
+ 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
run: ../target/debug/cargo-clippy
working-directory: clippy_workspace_tests
+ - name: Test cargo-clippy --fix
+ run: ../target/debug/cargo-clippy clippy --fix
+ working-directory: clippy_workspace_tests
+
- name: Test clippy-driver
run: bash .github/driver.sh
env:
OS: ${{ runner.os }}
+ - name: Test cargo dev new lint
+ run: |
+ cargo dev new_lint --name new_early_pass --pass early
+ cargo dev new_lint --name new_late_pass --pass late
+ cargo check
+ git reset --hard HEAD
+
integration_build:
needs: changelog
runs-on: ubuntu-latest