Skip to content

Commit

Permalink
Add workflow to verify crate packaging (#650)
Browse files Browse the repository at this point in the history
* Add workflow to verify crate packaging

Signed-off-by: Daniel Carl Jones <[email protected]>

* Fix indentation of workflow

Signed-off-by: Daniel Carl Jones <[email protected]>

---------

Signed-off-by: Daniel Carl Jones <[email protected]>
  • Loading branch information
dannycjones authored Nov 30, 2023
1 parent 099638e commit cc20c75
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Crate checks

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
merge_group:
types: [ "checks_requested" ]

jobs:
verify-crate:
name: Verify crate
runs-on: ubuntu-22.04

strategy:
matrix:
crate:
- mountpoint-s3-client
- mountpoint-s3-crt
- mountpoint-s3-crt-sys

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
- name: Set up stable Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Package ${{ matrix.crate }} crate
run: cargo package -p ${{ matrix.crate }}
- name: Verify compressed crate size is smaller than crates.io limit
run: |
ls -alh target/package/*.crate
test `cat target/package/*.crate | wc -c` -le 10485760

0 comments on commit cc20c75

Please sign in to comment.