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
- - name: Test Workspace
- run: cargo test --all --features deny-warnings,internal-lints
+ - name: Test
+ if: runner.os == 'Linux'
+ run: cargo test --features deny-warnings,internal
+
+ - name: Test
+ if: runner.os != 'Linux'
+ run: cargo test --features deny-warnings,internal -- --skip dogfood
+
+ - name: Test clippy_lints
+ run: cargo test --features deny-warnings,internal
+ working-directory: clippy_lints
+
+ - name: Test clippy_utils
+ run: cargo test --features deny-warnings,internal
+ working-directory: clippy_utils
+
+ - 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: