Skip to content

Commit

Permalink
chore(ci): update actions (#183)
Browse files Browse the repository at this point in the history
* chore(ci): update actions

* rm: leftover

* fix: justfile
  • Loading branch information
gabelluardo committed Mar 12, 2024
1 parent aa2e4bf commit c1bb89e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 39 deletions.
5 changes: 0 additions & 5 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# default target build is linux musl
# other targets need the `--target` flag
[build]
target = "x86_64-unknown-linux-musl"

[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "linker=ld.lld", "-C", "relocation-model=static"]

Expand Down
41 changes: 10 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:

env:
Expand All @@ -18,58 +18,37 @@ jobs:
matrix:
include:
- os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
- os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
- os: macos-latest
rust: stable
target: x86_64-apple-darwin

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
targets: ${{ matrix.target }}
components: rustfmt, clippy

- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-latest'
if: startsWith(matrix.os, 'ubuntu')
run: |
ci/ubuntu-install-packages
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --target ${{ matrix.target }} -- -D warnings
run: cargo clippy --target ${{ matrix.target }} -- -D warnings

- name: Build
run: cargo build --target ${{ matrix.target }}

- name: Install latest nextest release
uses: taiki-e/install-action@nextest

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --target ${{ matrix.target }}

- name: Test
uses: actions-rs/cargo@v1
with:
command: nextest
args: run --target ${{ matrix.target }}

run: cargo nextest run --target ${{ matrix.target }}
9 changes: 6 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ fix:
amend: pre-commit
git commit --amend --no-verify

release:
cargo build --release --locked --target x86_64-unknown-linux-musl

install:
cargo install --path . --target x86_64-unknown-linux-musl

test:
cargo nextest run
cargo nextest run --target x86_64-unknown-linux-musl

test-ignored:
cargo nextest run --run-ignored=ignored-only
cargo nextest run --run-ignored=ignored-only --target x86_64-unknown-linux-musl

test-all:
cargo nextest run --run-ignored=all
cargo nextest run --run-ignored=all --target x86_64-unknown-linux-musl

coverage:
cargo tarpaulin \
Expand Down

0 comments on commit c1bb89e

Please sign in to comment.