Skip to content

Commit ca5351d

Browse files
committed
build: add clippy
1 parent 4c8d958 commit ca5351d

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

.github/actions/build/build-src/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
if: startsWith(matrix.os, 'windows')
1212
working-directory: ${{ env.work_dir }}
1313
shell: pwsh
14-
run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --enable-extended --tools=rustfmt,cargo --dist-compression-formats='xz'
14+
run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --enable-extended --tools=clippy,cargo,rustfmt --dist-compression-formats='xz'
1515

1616
- name: Dist with x.py - Src - Windows
1717
if: startsWith(matrix.os, 'windows')
@@ -26,7 +26,7 @@ runs:
2626
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
2727
working-directory: ${{ env.work_dir }}
2828
shell: bash
29-
run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --enable-extended --tools=rustfmt,cargo --dist-compression-formats='xz'
29+
run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --enable-extended --tools=clippy,cargo,rustfmt --dist-compression-formats='xz'
3030

3131
- name: Dist with x.py - Src - Unix
3232
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')

.github/actions/build/build-tools/action.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ runs:
1111
if: startsWith(matrix.os, 'windows')
1212
working-directory: ${{ env.work_dir }}
1313
shell: pwsh
14-
run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --enable-extended --tools=rustfmt,cargo --dist-compression-formats='xz'
14+
run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --enable-extended --tools=clippy,cargo,rustfmt --dist-compression-formats='xz'
1515

1616
- name: Build with x.py - Tools
1717
if: startsWith(matrix.os, 'windows')
1818
# Note excluding src/doc breaks build of 1.55
1919
working-directory: ${{ env.work_dir }}
2020
shell: pwsh
2121
# We only want to do cargo for windows builds
22-
run: python3 x.py build --exclude src/doc --stage 2 src/tools/rustfmt src/tools/cargo
22+
run: python3 x.py build --exclude src/doc --stage 2 src/tools/clippy src/tools/rustfmt src/tools/cargo
2323

2424
- name: Dist with x.py - Tools
2525
if: startsWith(matrix.os, 'windows')
2626
# We include cargo to get around https://github.com/esp-rs/rust-build/issues/17
2727
working-directory: ${{ env.work_dir }}
2828
shell: pwsh
29-
run: python3 x.py dist --stage 2 rustfmt cargo
29+
run: python3 x.py dist --stage 2 clippy rustfmt cargo
3030

3131

3232
# Run Linux builds using bash
@@ -35,21 +35,21 @@ runs:
3535
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
3636
working-directory: ${{ env.work_dir }}
3737
shell: bash
38-
run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --enable-extended --tools=rustfmt,cargo --dist-compression-formats='xz'
38+
run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --enable-extended --tools=clippy,cargo,rustfmt --dist-compression-formats='xz'
3939

4040
- name: Build with x.py - Tools
4141
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
4242
# Note excluding src/doc breaks build of 1.55
4343
working-directory: ${{ env.work_dir }}
4444
shell: bash
45-
run: python3 x.py build --exclude src/doc --stage 2 src/tools/rustfmt
45+
run: python3 x.py build --exclude src/doc --stage 2 src/tools/clippy src/tools/rustfmt
4646

4747
- name: Dist with x.py - Tools
4848
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
4949
# We include cargo to get around https://github.com/esp-rs/rust-build/issues/17
5050
working-directory: ${{ env.work_dir }}
5151
shell: bash
52-
run: python3 x.py dist --stage 2 rustfmt cargo
52+
run: python3 x.py dist --stage 2 clippy rustfmt cargo
5353

5454

5555
# Save the result
@@ -67,3 +67,9 @@ runs:
6767
with:
6868
name: rustfmt-${{ env.build_suffix }}.tar.xz
6969
path: ${{ env.dist_dir }}/rustfmt-${{ env.build_suffix }}.tar.xz
70+
71+
- name: Save Artifact - Clippy
72+
uses: actions/upload-artifact@v2
73+
with:
74+
name: clippy-${{ env.build_suffix }}.tar.xz
75+
path: ${{ env.dist_dir }}/clippy-${{ env.build_suffix }}.tar.xz

.github/actions/util/create-archive/action.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ runs:
3030
tar -xvf ./rust-std-${{ env.build_suffix }}.tar.xz
3131
cp -af ./rust-std-${{ env.build_suffix }}/rust-std-${{ matrix.target_name }}/* ./esp/
3232
33+
# Copy in the clippy tool
34+
tar -xvf ./clippy-${{ env.build_suffix }}.tar.xz
35+
cp -af ./clippy-${{ env.build_suffix }}/clippy-preview/* ./esp/
36+
3337
# Copy in the cargo tool
3438
tar -xvf ./cargo-${{ env.build_suffix }}.tar.xz
3539
cp -af ./cargo-${{ env.build_suffix }}/cargo/* ./esp/
@@ -62,6 +66,10 @@ runs:
6266
tar -xvf ./rust-std-${{ env.build_suffix }}.tar.xz
6367
cp -af ./rust-std-${{ env.build_suffix }}/* ./${{ env.archive_dir }}/
6468
69+
# Copy in the clippy tool
70+
tar -xvf ./clippy-${{ env.build_suffix }}.tar.xz
71+
cp -af ./clippy-${{ env.build_suffix }}/* ./${{ env.archive_dir }}/
72+
6573
# Copy in the rustfmt tool
6674
tar -xvf ./rustfmt-${{ env.build_suffix }}.tar.xz
6775
cp -af ./rustfmt-${{ env.build_suffix }}/* ./${{ env.archive_dir }}/
@@ -75,6 +83,7 @@ runs:
7583
# Make sure the other components are recognised by the install script
7684
echo "rust-std-${{ matrix.target_name }}" >> ./${{ env.archive_dir }}/components
7785
echo "rustfmt-preview" >> ./${{ env.archive_dir }}/components
86+
echo "clippy-preview" >> ./${{ env.archive_dir }}/components
7887
7988
# Build the final tar
8089
tar -cJf ${{ env.asset_name }} ${{ env.archive_dir }}

.github/actions/util/read-artifacts/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ runs:
1515
with:
1616
name: rust-std-${{ env.build_suffix }}.tar.xz
1717

18+
- name: Read Artifact - Clippy
19+
uses: actions/download-artifact@v2
20+
with:
21+
name: clippy-${{ env.build_suffix }}.tar.xz
22+
1823
- name: Read Artifact - RustFmt
1924
uses: actions/download-artifact@v2
2025
with:

.github/workflows/build-rust-aarch64-apple-darwin-dispatch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-18.04' || matrix.os == 'windows-latest' }}
6161
uses: seanmiddleditch/gha-setup-ninja@master
6262
- name: Prepare build
63-
run: python3 src/bootstrap/configure.py ${{ matrix.LLVM_ROOT_OPTION }} --experimental-targets=Xtensa --enable-extended --tools=rustfmt --dist-compression-formats='xz'
63+
run: python3 src/bootstrap/configure.py ${{ matrix.LLVM_ROOT_OPTION }} --experimental-targets=Xtensa --enable-extended --tools=clippy,cargo,rustfmt --dist-compression-formats='xz'
6464
- name: Build with x.py - dist packages
6565
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-18.04' }}
6666
run: python3 x.py dist --stage 2

0 commit comments

Comments
 (0)