Skip to content

Commit

Permalink
chore: update dependencies + minor changes (#212)
Browse files Browse the repository at this point in the history
* fix: bump checkout action to v4 and install libX11 on linux before running tests
* migrate to dtolnays rust setup
* update the apt package before installing
* dismiss the caching action usages
* fix deprecated upload-artifact action
* chore: update clap to 4.5
  • Loading branch information
sassman authored Jan 11, 2025
1 parent aae8041 commit 1da917e
Show file tree
Hide file tree
Showing 9 changed files with 289 additions and 597 deletions.
50 changes: 24 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
name: Build
on:
push:
branches: [ '*' ]
branches: ["*"]
paths-ignore:
- "**/docs/**"
- "**.md"
pull_request:
branches: [ main ]
branches: [main]
paths-ignore:
- "**/docs/**"
- "**.md"
Expand All @@ -23,93 +23,91 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [ 'macos-latest', 'ubuntu-latest']
version: ["macos-latest", "ubuntu-latest"]
runs-on: ${{ matrix.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: setup | rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
default: true
profile: minimal
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v1
- run: cargo check

lint:
name: lint
needs: check
strategy:
fail-fast: false
matrix:
version: [ 'macos-latest', 'ubuntu-latest']
version: ["macos-latest", "ubuntu-latest"]
cargo-cmd:
- fmt --all -- --check
- clippy --all-targets --all-features -- -D warnings
runs-on: ${{ matrix.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: setup | rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
default: true
profile: minimal
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v1
- run: cargo ${{ matrix['cargo-cmd'] }}

tests:
name: test
needs: check
strategy:
fail-fast: false
matrix:
version: [ 'macos-latest', 'ubuntu-latest']
rust: [ nightly, stable ]
version: ["macos-latest", "ubuntu-latest"]
rust: [nightly, stable]
runs-on: ${{ matrix.version }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: setup | rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
default: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- if: ${{ matrix.version == 'ubuntu-latest' }}
name: install libX11-devel for libX11
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev
- name: cargo test
run: cargo test --all --locked -- -Z unstable-options
run: cargo test --all --locked

pkg-deb:
name: binary package .deb
needs: check
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: build .deb file
uses: sassman/rust-deb-builder@v1
- name: Archive deb artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: t-rec-amd64-static.deb
path: target/x86_64-unknown-linux-musl/debian/t-rec*.deb

audit:
name: security audit
needs: check
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: setup | rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
default: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 6 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Deploy
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
paths-ignore:
- "**/docs/**"
- "**.md"
Expand All @@ -17,14 +17,13 @@ jobs:
needs: [doing-a-build]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: setup | rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
default: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand All @@ -46,14 +45,13 @@ jobs:
needs: [publish]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: setup | rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
default: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Get version from tag
id: tag_name
run: echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/release-binary-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ jobs:
cross: false
binName: t-rec
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Build
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -65,7 +64,7 @@ jobs:
name: binary package .deb
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: build .deb file
env:
TARGET: x86_64-unknown-linux-musl
Expand All @@ -87,4 +86,3 @@ jobs:
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true

Loading

0 comments on commit 1da917e

Please sign in to comment.