Skip to content

Commit

Permalink
Rework CI to use supported actions
Browse files Browse the repository at this point in the history
  • Loading branch information
theirix committed Sep 7, 2023
1 parent df619dd commit 8fc571a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 43 deletions.
37 changes: 7 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
#
on:
push:
branches:
Expand All @@ -17,16 +15,10 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
run: cargo check

test:
name: Test Suite
Expand All @@ -36,16 +28,10 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test

lints:
name: Lints
Expand All @@ -55,24 +41,15 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
run: cargo clippy -- -D warnings

musl:
name: Build musl
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.target }}

- name: Install dependencies
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get install musl-tools libssl-dev
run: sudo apt-get install musl-tools musl-dev libssl-dev perl make

- name: Build artifact
run: cargo build --release --target=${{ matrix.target }}
Expand Down Expand Up @@ -83,15 +80,9 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable

- name: Run cargo publish
uses: actions-rs/cargo@v1
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
with:
command: publish
run: cargo publish

0 comments on commit 8fc571a

Please sign in to comment.