Using clippy action

Removed build-examples job

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
This commit is contained in:
slinkydeveloper 2020-10-30 09:43:32 +01:00 committed by Francesco Guardiani
parent 0f9c9bd08f
commit 3770f99e77
2 changed files with 34 additions and 48 deletions

View File

@ -22,8 +22,8 @@ jobs:
with: with:
command: fmt command: fmt
args: --all -- --check args: --all -- --check
- uses: actions-rs/cargo@v1 - uses: actions-rs/clippy-check@v1
name: "Cargo clippy" name: "Cargo clippy"
with: with:
command: clippy token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings args: --all-features

View File

@ -24,10 +24,14 @@ jobs:
- wasm32-unknown-unknown - wasm32-unknown-unknown
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
# Setup musl if needed
- run: sudo apt-get update - run: sudo apt-get update
if: matrix.target == 'x86_64-unknown-linux-musl' if: matrix.target == 'x86_64-unknown-linux-musl'
- run: sudo apt-get install -y musl musl-dev musl-tools cmake - run: sudo apt-get install -y musl musl-dev musl-tools cmake
if: matrix.target == 'x86_64-unknown-linux-musl' if: matrix.target == 'x86_64-unknown-linux-musl'
# Caching stuff
- name: Cache cargo registry - name: Cache cargo registry
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
@ -51,12 +55,14 @@ jobs:
# If glibc, compile and test all # If glibc, compile and test all
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
name: "Build"
if: matrix.target == 'x86_64-unknown-linux-gnu' if: matrix.target == 'x86_64-unknown-linux-gnu'
with: with:
command: build command: build
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
args: --target ${{ matrix.target }} --workspace args: --target ${{ matrix.target }} --workspace
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
name: "Test"
if: matrix.target == 'x86_64-unknown-linux-gnu' if: matrix.target == 'x86_64-unknown-linux-gnu'
with: with:
command: test command: test
@ -65,6 +71,7 @@ jobs:
# If musl, compile and test all # If musl, compile and test all
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
name: "Build"
if: matrix.target == 'x86_64-unknown-linux-musl' if: matrix.target == 'x86_64-unknown-linux-musl'
with: with:
command: build command: build
@ -74,6 +81,7 @@ jobs:
CC: musl-gcc CC: musl-gcc
CXX: g++ CXX: g++
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
name: "Test"
if: matrix.target == 'x86_64-unknown-linux-musl' if: matrix.target == 'x86_64-unknown-linux-musl'
with: with:
command: test command: test
@ -85,56 +93,34 @@ jobs:
# If wasm, then we test only the main module and cloudevents-sdk-reqwest # If wasm, then we test only the main module and cloudevents-sdk-reqwest
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
name: "Build"
if: matrix.target == 'wasm32-unknown-unknown' if: matrix.target == 'wasm32-unknown-unknown'
with: with:
command: build command: build
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
args: --target wasm32-unknown-unknown --package cloudevents-sdk --package cloudevents-sdk-reqwest args: --target wasm32-unknown-unknown --package cloudevents-sdk --package cloudevents-sdk-reqwest
build-examples: # Build examples
name: Examples ${{ matrix.toolchain }} / ${{ matrix.target }} - uses: actions-rs/cargo@v1
runs-on: ubuntu-latest name: "Build reqwest-wasm-example"
needs: build if: matrix.target == 'wasm32-unknown-unknown' && matrix.toolchain == 'stable'
strategy: with:
fail-fast: false command: build
matrix: toolchain: ${{ matrix.toolchain }}
target: args: --target ${{ matrix.target }} --manifest-path ${GITHUB_WORKSPACE}/example-projects/reqwest-wasm-example/Cargo.toml
- x86_64-unknown-linux-gnu
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v2
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-stable-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
override: true
- name: "Build reqwest-wasm-example" - uses: actions-rs/cargo@v1
if: matrix.target == 'wasm32-unknown-unknown' name: "Build rdkafka-example"
working-directory: ${GITHUB_WORKSPACE}/example-projects/reqwest-wasm-example if: matrix.target == 'x86_64-unknown-linux-gnu' && matrix.toolchain == 'stable'
run: cargo build --target ${{ matrix.target }} with:
command: build
toolchain: ${{ matrix.toolchain }}
args: --target ${{ matrix.target }} --manifest-path ${GITHUB_WORKSPACE}/example-projects/rdkafka-example/Cargo.toml
- name: "Build rdkafka-example" - uses: actions-rs/cargo@v1
if: matrix.target == 'x86_64-unknown-linux-gnu' name: "Build actix-web-example"
working-directory: ${GITHUB_WORKSPACE}/example-projects/rdkafka-example if: matrix.target == 'x86_64-unknown-linux-gnu' && matrix.toolchain == 'stable'
run: cargo build --target ${{ matrix.target }} with:
command: build
- name: "Build actix-web-example" toolchain: ${{ matrix.toolchain }}
if: matrix.target == 'x86_64-unknown-linux-gnu' args: --target ${{ matrix.target }} --manifest-path ${GITHUB_WORKSPACE}/example-projects/actix-web-example/Cargo.toml
working-directory: ${GITHUB_WORKSPACE}/example-projects/actix-web-example
run: cargo build --target ${{ matrix.target }}