From 65203bdb83bd6232304e18a0c4eed3151d3c9489 Mon Sep 17 00:00:00 2001 From: Andrew Korzhuev Date: Tue, 25 Jul 2023 14:05:37 +0200 Subject: [PATCH] relax lib versions, split build per platform --- .github/workflows/build.yml | 99 +++++++++++++++++++++++++++++-------- jwt/Cargo.toml | 6 +-- 2 files changed, 81 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3be58c7..797f3df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,10 +10,7 @@ jobs: check: name: Check - strategy: - matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -27,12 +24,9 @@ jobs: with: command: check - test: - name: Test - strategy: - matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.platform }} + lints: + name: Lints + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -40,15 +34,39 @@ jobs: profile: minimal toolchain: stable override: true + components: rustfmt, clippy + - name: cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + + windows-test: + name: windows-vcpkg + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: vcpkg install openssl:x64-windows-static-md - name: Run cargo test uses: actions-rs/cargo@v1 with: command: test - lints: - name: Lints - runs-on: ubuntu-latest + macos-test: + name: macos-homebrew + runs-on: macos-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -56,16 +74,55 @@ jobs: profile: minimal toolchain: stable override: true - components: rustfmt, clippy - - - name: cargo fmt + - name: Run cargo test uses: actions-rs/cargo@v1 with: - command: fmt - args: --all -- --check + command: test - - name: cargo clippy + linux: + strategy: + fail-fast: false + matrix: + target: + - x86_64-unknown-linux-gnu + - i686-unknown-linux-gnu + - arm-unknown-linux-gnueabihf + name: ${{ matrix.target }} + runs-on: ubuntu-latest + env: + OPENSSL_DIR: /opt/openssl + CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc + CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_AR: arm-linux-gnueabihf-ar + CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER: qemu-arm -L /usr/arm-linux-gnueabihf + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Install packages + run: | + case "${{ matrix.target }}" in + "x86_64-unknown-linux-gnu") + packages="openssl-dev" + ;; + "i686-unknown-linux-gnu") + packages="gcc-multilib g++-multilib openssl-dev" + ;; + "arm-unknown-linux-gnueabihf") + packages="gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf qemu-user" + ;; + esac + + sudo apt-get update + sudo apt-get install -y openssl-dev + - run: | + echo "RUST_TEST_THREADS=1" >> $GITHUB_ENV + echo BINDGEN_EXTRA_CLANG_ARGS="--sysroot /usr/arm-linux-gnueabihf" >> $GITHUB_ENV + if: matrix.target == 'arm-unknown-linux-gnueabihf' + - name: Run cargo test uses: actions-rs/cargo@v1 with: - command: clippy - args: -- -D warnings \ No newline at end of file + command: test diff --git a/jwt/Cargo.toml b/jwt/Cargo.toml index 200d2df..71812d4 100644 --- a/jwt/Cargo.toml +++ b/jwt/Cargo.toml @@ -10,9 +10,9 @@ thiserror = "1" sha2 = "0.10" base64 = "0.21" jsonwebtoken = "8" -openssl = "0.10.46" -serde = "1.0.156" -time = "0.3.20" +openssl = "0.10" +serde = "1" +time = "0.3" [dev-dependencies] anyhow = "1"