Skip to content

Commit

Permalink
relax lib versions, split build per platform
Browse files Browse the repository at this point in the history
  • Loading branch information
andrusha committed Jul 25, 2023
1 parent 62299d3 commit 65203bd
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 24 deletions.
99 changes: 78 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,45 +24,105 @@ 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
with:
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
with:
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
command: test
6 changes: 3 additions & 3 deletions jwt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 65203bd

Please sign in to comment.