Skip to content

Commit

Permalink
ci: Run bindgen for libmagic versions for comparison
Browse files Browse the repository at this point in the history
Signed-off-by: robot9001 <[email protected]>
  • Loading branch information
robo9k committed Oct 14, 2023
1 parent af5aea7 commit f04ec8d
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/test-libmagic-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
name: "cargo test"
name: "cargo test && bindgen"
permissions:
contents: read
strategy:
Expand All @@ -32,7 +32,7 @@ jobs:

- run: |
sudo apt-get update
sudo apt-get install automake gcc libtool make python3 zlib1g-dev
sudo apt-get install automake gcc libtool make python3 zlib1g-dev llvm-dev libclang-dev clang
- run: curl --output file-${{ matrix.version }}.tgz https://astron.com/pub/file/file-${{ matrix.version }}.tar.gz

Expand Down Expand Up @@ -65,9 +65,32 @@ jobs:
with:
toolchain: "1.54.0" # hardcoded crate MSRV, see rust-toolchain.toml etc.
# minimal profile includes rustc component which includes cargo and rustdoc
components: "rustfmt"

- uses: rui314/setup-mold@354d1662b2a6f02e5eccc9712f22657621bf645b # does not have recent tags

- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0

- run: cargo +${{ steps.toolchain.outputs.name }} test --all-targets --all-features --verbose

- uses: taiki-e/install-action@47d27149ff6b3422864ec504071d5cc7873d642e # v2.20.3
with:
tool: [email protected]

# bindgen doesn't exactly match crate MSRV
- run: >
bindgen
--use-core
--no-size_t-is-usize
--allowlist-file '${{ steps.prefix.outputs.dir }}/include/magic.h'
--opaque-type 'magic_set'
--no-copy 'magic_set'
--rust-target '1.47'
--output 'bindings.rs'
'${{ steps.prefix.outputs.dir }}/include/magic.h'
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: bindgen-${{ matrix.version }}
path: |
bindings.rs

0 comments on commit f04ec8d

Please sign in to comment.