-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplfying CI setup and bind to Rust 1.83
- Loading branch information
Showing
3 changed files
with
44 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,26 +40,9 @@ jobs: | |
- name: Install libudev-dev | ||
run: sudo apt-get update && sudo apt-get install libudev-dev | ||
if: matrix.job.os == 'ubuntu-latest' || matrix.job.os == 'self-hosted' | ||
- name: Cache Rust dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: target | ||
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.OS }}-build- | ||
- name: Install latest Rust nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
components: rustc, cargo | ||
toolchain: nightly | ||
override: true | ||
target: ${{ matrix.job.target }} | ||
- name: Run cargo build --release | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
args: --release --target=${{ matrix.job.target }} | ||
command: build | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Build in release mode | ||
run: cargo build --release --target=${{ matrix.job.target }} | ||
- name: Sanitise Git ref for use in filenames | ||
id: sanitise_ref | ||
run: echo "::set-output name=value::$(echo "${{ github.ref_name }}" | tr '/' '_')" | ||
|
@@ -164,20 +147,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- name: Install libudev-dev | ||
run: sudo apt-get update && sudo apt-get install libudev-dev | ||
- name: Cache Rust dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: target | ||
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.OS }}-build- | ||
- name: Install latest Rust nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
components: rustc, cargo | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Install cargo-edit | ||
run: cargo install cargo-edit | ||
- name: Set the version to a dummy version to allow publishing | ||
|
@@ -234,19 +204,8 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- name: Install libudev-dev | ||
run: sudo apt-get update && sudo apt-get install libudev-dev | ||
- name: Cache Rust dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: target | ||
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.OS }}-build- | ||
- name: Install latest Rust nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
components: rustc, cargo | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Build in release mode | ||
run: cargo build --release --target=${{ matrix.job.target }} | ||
- name: Publish to Crates.io | ||
run: cargo publish --token ${{ secrets.CRATES_IO_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,40 +8,35 @@ jobs: | |
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install libudev-dev | ||
run: sudo apt-get update && sudo apt-get install libudev-dev | ||
|
||
- name: Install latest Rust nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
components: rustc, rustfmt, clippy | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
|
||
- name: Detect code style issues | ||
uses: pre-commit/[email protected] | ||
env: | ||
SKIP: no-commit-to-branch | ||
|
||
- name: Generate patch file | ||
if: failure() | ||
run: | | ||
git diff-index -p HEAD > "${PATCH_FILE}" | ||
[ -s "${PATCH_FILE}" ] && echo "UPLOAD_PATCH_FILE=${PATCH_FILE}" >> "${GITHUB_ENV}" | ||
env: | ||
PATCH_FILE: pre-commit.patch | ||
|
||
- name: Upload patch artifact | ||
if: failure() && env.UPLOAD_PATCH_FILE != null | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.UPLOAD_PATCH_FILE }} | ||
path: ${{ env.UPLOAD_PATCH_FILE }} | ||
- name: Install libudev-dev | ||
run: sudo apt-get update && sudo apt-get install libudev-dev | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Detect code style issues | ||
uses: pre-commit/[email protected] | ||
env: | ||
SKIP: no-commit-to-branch | ||
|
||
- name: Generate patch file | ||
if: failure() | ||
run: | | ||
git diff-index -p HEAD > "${PATCH_FILE}" | ||
[ -s "${PATCH_FILE}" ] && echo "UPLOAD_PATCH_FILE=${PATCH_FILE}" >> "${GITHUB_ENV}" | ||
env: | ||
PATCH_FILE: pre-commit.patch | ||
|
||
- name: Upload patch artifact | ||
if: failure() && env.UPLOAD_PATCH_FILE != null | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.UPLOAD_PATCH_FILE }} | ||
path: ${{ env.UPLOAD_PATCH_FILE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[toolchain] | ||
channel = "1.83.0" | ||
components = [ "rustc", "rustfmt", "clippy" ] | ||
targets = [ "x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-pc-windows-msvc" ] | ||
profile = "minimal" |