Skip to content

Commit 3770f99

Browse files
Using clippy action
Removed build-examples job Signed-off-by: Francesco Guardiani <[email protected]>
1 parent 0f9c9bd commit 3770f99

File tree

2 files changed

+34
-48
lines changed

2 files changed

+34
-48
lines changed

.github/workflows/pull_requests_lints.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
with:
2323
command: fmt
2424
args: --all -- --check
25-
- uses: actions-rs/cargo@v1
25+
- uses: actions-rs/clippy-check@v1
2626
name: "Cargo clippy"
2727
with:
28-
command: clippy
29-
args: -- -D warnings
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
args: --all-features

.github/workflows/rust_tests.yml

Lines changed: 31 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ jobs:
2424
- wasm32-unknown-unknown
2525
steps:
2626
- uses: actions/checkout@v2
27+
28+
# Setup musl if needed
2729
- run: sudo apt-get update
2830
if: matrix.target == 'x86_64-unknown-linux-musl'
2931
- run: sudo apt-get install -y musl musl-dev musl-tools cmake
3032
if: matrix.target == 'x86_64-unknown-linux-musl'
33+
34+
# Caching stuff
3135
- name: Cache cargo registry
3236
uses: actions/cache@v1
3337
with:
@@ -51,12 +55,14 @@ jobs:
5155

5256
# If glibc, compile and test all
5357
- uses: actions-rs/cargo@v1
58+
name: "Build"
5459
if: matrix.target == 'x86_64-unknown-linux-gnu'
5560
with:
5661
command: build
5762
toolchain: ${{ matrix.toolchain }}
5863
args: --target ${{ matrix.target }} --workspace
5964
- uses: actions-rs/cargo@v1
65+
name: "Test"
6066
if: matrix.target == 'x86_64-unknown-linux-gnu'
6167
with:
6268
command: test
@@ -65,6 +71,7 @@ jobs:
6571

6672
# If musl, compile and test all
6773
- uses: actions-rs/cargo@v1
74+
name: "Build"
6875
if: matrix.target == 'x86_64-unknown-linux-musl'
6976
with:
7077
command: build
@@ -74,6 +81,7 @@ jobs:
7481
CC: musl-gcc
7582
CXX: g++
7683
- uses: actions-rs/cargo@v1
84+
name: "Test"
7785
if: matrix.target == 'x86_64-unknown-linux-musl'
7886
with:
7987
command: test
@@ -85,56 +93,34 @@ jobs:
8593

8694
# If wasm, then we test only the main module and cloudevents-sdk-reqwest
8795
- uses: actions-rs/cargo@v1
96+
name: "Build"
8897
if: matrix.target == 'wasm32-unknown-unknown'
8998
with:
9099
command: build
91100
toolchain: ${{ matrix.toolchain }}
92101
args: --target wasm32-unknown-unknown --package cloudevents-sdk --package cloudevents-sdk-reqwest
93102

94-
build-examples:
95-
name: Examples ${{ matrix.toolchain }} / ${{ matrix.target }}
96-
runs-on: ubuntu-latest
97-
needs: build
98-
strategy:
99-
fail-fast: false
100-
matrix:
101-
target:
102-
- x86_64-unknown-linux-gnu
103-
- wasm32-unknown-unknown
104-
steps:
105-
- uses: actions/checkout@v2
106-
- name: Cache cargo registry
107-
uses: actions/cache@v1
108-
with:
109-
path: ~/.cargo/registry
110-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
111-
- name: Cache cargo index
112-
uses: actions/cache@v1
113-
with:
114-
path: ~/.cargo/git
115-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
116-
- name: Cache cargo build
117-
uses: actions/cache@v1
118-
with:
119-
path: target
120-
key: ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-stable-${{ hashFiles('**/Cargo.lock') }}
121-
- uses: actions-rs/toolchain@v1
122-
with:
123-
toolchain: ${{ matrix.toolchain }}
124-
target: ${{ matrix.target }}
125-
override: true
126-
127-
- name: "Build reqwest-wasm-example"
128-
if: matrix.target == 'wasm32-unknown-unknown'
129-
working-directory: ${GITHUB_WORKSPACE}/example-projects/reqwest-wasm-example
130-
run: cargo build --target ${{ matrix.target }}
103+
# Build examples
104+
- uses: actions-rs/cargo@v1
105+
name: "Build reqwest-wasm-example"
106+
if: matrix.target == 'wasm32-unknown-unknown' && matrix.toolchain == 'stable'
107+
with:
108+
command: build
109+
toolchain: ${{ matrix.toolchain }}
110+
args: --target ${{ matrix.target }} --manifest-path ${GITHUB_WORKSPACE}/example-projects/reqwest-wasm-example/Cargo.toml
131111

132-
- name: "Build rdkafka-example"
133-
if: matrix.target == 'x86_64-unknown-linux-gnu'
134-
working-directory: ${GITHUB_WORKSPACE}/example-projects/rdkafka-example
135-
run: cargo build --target ${{ matrix.target }}
112+
- uses: actions-rs/cargo@v1
113+
name: "Build rdkafka-example"
114+
if: matrix.target == 'x86_64-unknown-linux-gnu' && matrix.toolchain == 'stable'
115+
with:
116+
command: build
117+
toolchain: ${{ matrix.toolchain }}
118+
args: --target ${{ matrix.target }} --manifest-path ${GITHUB_WORKSPACE}/example-projects/rdkafka-example/Cargo.toml
136119

137-
- name: "Build actix-web-example"
138-
if: matrix.target == 'x86_64-unknown-linux-gnu'
139-
working-directory: ${GITHUB_WORKSPACE}/example-projects/actix-web-example
140-
run: cargo build --target ${{ matrix.target }}
120+
- uses: actions-rs/cargo@v1
121+
name: "Build actix-web-example"
122+
if: matrix.target == 'x86_64-unknown-linux-gnu' && matrix.toolchain == 'stable'
123+
with:
124+
command: build
125+
toolchain: ${{ matrix.toolchain }}
126+
args: --target ${{ matrix.target }} --manifest-path ${GITHUB_WORKSPACE}/example-projects/actix-web-example/Cargo.toml

0 commit comments

Comments
 (0)