Skip to content

Commit

Permalink
substituted rust toolchain in CI (from actions-rs to dtlonay)
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Jan 11, 2024
1 parent cdec7c8 commit dfc4d50
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 88 deletions.
57 changes: 18 additions & 39 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,9 @@ jobs:
Write-Host "::endgroup::"
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
default: true

- name: Add build targets
if: ${{ matrix.os == 'macos' }}
run: |
rustup target add \
x86_64-apple-darwin \
aarch64-apple-darwin
- name: Add build targets
if: ${{ matrix.os == 'windows' }}
run: |
rustup target add `
i686-pc-windows-msvc `
x86_64-pc-windows-msvc
targets: ${{ matrix.target }}

- name: Install Cross
if: ${{ matrix.os == 'ubuntu' }}
Expand All @@ -94,10 +78,7 @@ jobs:

- name: Build binary
if: ${{ matrix.os == 'macos' || matrix.os == 'windows' }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.target }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -134,11 +115,9 @@ jobs:
run: apt update -y && apt install -y curl build-essential

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

- name: Install packaging tools
run: cargo install cargo-deb
Expand All @@ -147,6 +126,7 @@ jobs:
with:
name: build-ubuntu-${{ matrix.target }}
path: target/
if-no-files-found: error

- name: Package for Debian-based Linux distros
shell: bash
Expand All @@ -160,6 +140,7 @@ jobs:
with:
name: deb-${{ matrix.arch }}
path: artifacts/
if-no-files-found: error

rpm:
runs-on: ubuntu-latest
Expand All @@ -183,11 +164,9 @@ jobs:
run: dnf update -y && dnf install -y @development-tools patchelf

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

- name: Install packaging tools
run: cargo install cargo-generate-rpm
Expand All @@ -196,6 +175,7 @@ jobs:
with:
name: build-ubuntu-${{ matrix.target }}
path: target/
if-no-files-found: error

- name: Package for RPM-based Linux distros
shell: bash
Expand All @@ -210,6 +190,7 @@ jobs:
with:
name: rpm-${{ matrix.arch }}
path: artifacts/
if-no-files-found: error

dmg:
runs-on: macos-latest
Expand All @@ -228,11 +209,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Install packaging tools
run: |
Expand All @@ -243,6 +220,7 @@ jobs:
with:
name: build-macos-${{ matrix.target }}
path: target/
if-no-files-found: error

- name: Package for macOS
shell: bash
Expand Down Expand Up @@ -277,6 +255,7 @@ jobs:
with:
name: dmg-${{ matrix.arch }}
path: artifacts/
if-no-files-found: error

msi:
runs-on: windows-latest
Expand Down Expand Up @@ -306,11 +285,9 @@ jobs:
Write-Host "::endgroup::"
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
default: true
targets: ${{ matrix.target }}

- name: Install packaging tools
run: cargo install cargo-wix
Expand All @@ -319,6 +296,7 @@ jobs:
with:
name: build-windows-${{ matrix.target }}
path: target/
if-no-files-found: error

- name: Package for Microsoft Windows
shell: powershell
Expand All @@ -332,3 +310,4 @@ jobs:
with:
name: msi-${{ matrix.arch }}
path: artifacts/
if-no-files-found: error
61 changes: 12 additions & 49 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,15 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- name: install fmt
run: rustup component add rustfmt
- name: install clippy
run: rustup component add clippy
components: rustfmt, clippy
- name: fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check
- name: build
run: cargo build --verbose
- name: clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
run: cargo clippy -- -D warnings
- name: test
run: cargo test --verbose

Expand All @@ -52,33 +40,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install libpcap
run: sudo apt-get install libpcap-dev
- name: Install dependency for alsa-sys
run: sudo apt-get install libasound2-dev
- name: Install dependency for rfd
run: sudo apt-get install libgtk-3-dev
- name: install fmt
run: rustup component add rustfmt
- name: install clippy
run: rustup component add clippy
- name: fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check
- name: build
run: cargo build --verbose
- name: clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
run: cargo clippy -- -D warnings
- name: test
run: cargo test --verbose

Expand All @@ -87,11 +63,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install npcap sdk
run: |
Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "C:/npcap-sdk.zip"
Expand All @@ -104,25 +78,14 @@ jobs:
run: |
Invoke-WebRequest -Uri ${{secrets.NPCAP_OEM_URL}} -OutFile C:/npcap-oem.exe
C:/npcap-oem.exe /S
- name: install fmt
run: rustup component add rustfmt
- name: install clippy
run: rustup component add clippy
- name: fmt
if: github.event_name != 'pull_request'
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check
- name: build
if: github.event_name != 'pull_request'
run: cargo build --verbose
- name: clippy
if: github.event_name != 'pull_request'
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
run: cargo clippy -- -D warnings
- name: test
if: github.event_name != 'pull_request'
run: cargo test --verbose

0 comments on commit dfc4d50

Please sign in to comment.