Skip to content

Commit

Permalink
Split CI into OS-specific workflows (#351)
Browse files Browse the repository at this point in the history
* Split CI into OS-specific workflows

* I hate github actions

* Simplifications and clarifications

* Update README

* Fix

* Fix

* Try

* Explicit jobs are much clearer
  • Loading branch information
Wojtek242 authored Apr 21, 2024
1 parent 3977426 commit a4a44d2
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 100 deletions.
99 changes: 0 additions & 99 deletions .github/workflows/00-ci.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/00-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Linux'

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 6 * * *"

jobs:
linux-build-and-test-stable:
uses: './.github/workflows/01-build-and-test-unix.yml'
with:
os: 'ubuntu-latest'
toolchain: 'stable'

linux-build-and-test-beta:
uses: './.github/workflows/01-build-and-test-unix.yml'
with:
os: 'ubuntu-latest'
toolchain: 'beta'

linux-build-and-test-msrv:
uses: './.github/workflows/01-build-and-test-unix.yml'
with:
os: 'ubuntu-latest'
toolchain: '1.63'
msrv: true

# Nightly check is performed on ubuntu only.
linux-build-and-test-nightly:
uses: './.github/workflows/01-build-and-test-unix.yml'
with:
os: 'ubuntu-latest'
toolchain: 'nightly'

linux-coverage-stable:
uses: './.github/workflows/02-coverage.yml'
with:
os: 'ubuntu-latest'

linux-lint-stable:
uses: './.github/workflows/03-lint.yml'
with:
os: 'ubuntu-latest'
39 changes: 39 additions & 0 deletions .github/workflows/00-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Mac OS'

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 6 * * *"

jobs:
macos-build-and-test-stable:
uses: './.github/workflows/01-build-and-test-unix.yml'
with:
os: 'macos-latest'
toolchain: 'stable'

macos-build-and-test-beta:
uses: './.github/workflows/01-build-and-test-unix.yml'
with:
os: 'macos-latest'
toolchain: 'beta'

macos-build-and-test-msrv:
uses: './.github/workflows/01-build-and-test-unix.yml'
with:
os: 'macos-latest'
toolchain: '1.63'
msrv: true

macos-coverage-stable:
uses: './.github/workflows/02-coverage.yml'
with:
os: 'macos-latest'

macos-lint-stable:
uses: './.github/workflows/03-lint.yml'
with:
os: 'macos-latest'
48 changes: 48 additions & 0 deletions .github/workflows/00-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'Windows'

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 6 * * *"

jobs:
windows-build-and-test-stable:
uses: './.github/workflows/01-build-and-test-windows.yml'
with:
os: 'windows-latest'
toolchain: 'stable'
secrets:
NPCAP_OEM_PASSWORD: ${{ secrets.NPCAP_OEM_PASSWORD }}
NPCAP_OEM_USERNAME: ${{ secrets.NPCAP_OEM_USERNAME }}

windows-build-and-test-beta:
uses: './.github/workflows/01-build-and-test-windows.yml'
with:
os: 'windows-latest'
toolchain: 'beta'
secrets:
NPCAP_OEM_PASSWORD: ${{ secrets.NPCAP_OEM_PASSWORD }}
NPCAP_OEM_USERNAME: ${{ secrets.NPCAP_OEM_USERNAME }}

windows-build-and-test-msrv:
uses: './.github/workflows/01-build-and-test-windows.yml'
with:
os: 'windows-latest'
toolchain: '1.63'
msrv: true
secrets:
NPCAP_OEM_PASSWORD: ${{ secrets.NPCAP_OEM_PASSWORD }}
NPCAP_OEM_USERNAME: ${{ secrets.NPCAP_OEM_USERNAME }}

windows-coverage-stable:
uses: './.github/workflows/02-coverage.yml'
with:
os: 'windows-latest'

windows-lint-stable:
uses: './.github/workflows/03-lint.yml'
with:
os: 'windows-latest'
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

This is a **Rust language** crate for accessing the packet sniffing capabilities of libpcap (or Npcap on Windows). If you need anything, feel free to post an issue or submit a pull request!

[![CI](https://github.com/rust-pcap/pcap/actions/workflows/00-ci.yml/badge.svg)](https://github.com/rust-pcap/pcap/actions/workflows/00-ci.yml)
[![CI](https://github.com/rust-pcap/pcap/actions/workflows/00-linux.yml/badge.svg)](https://github.com/rust-pcap/pcap/actions/workflows/00-linux.yml)
[![CI](https://github.com/rust-pcap/pcap/actions/workflows/00-macos.yml/badge.svg)](https://github.com/rust-pcap/pcap/actions/workflows/00-macos.yml)
[![CI](https://github.com/rust-pcap/pcap/actions/workflows/00-windows.yml/badge.svg)](https://github.com/rust-pcap/pcap/actions/workflows/00-windows.yml)
[![Coverage](https://rust-pcap.github.io/pcap/badges/flat.svg)](https://rust-pcap.github.io/pcap/index.html)
[![Crates.io](https://img.shields.io/crates/v/pcap.svg)](https://crates.io/crates/pcap)
[![Docs.rs](https://docs.rs/pcap/badge.svg)](https://docs.rs/pcap)
Expand Down

0 comments on commit a4a44d2

Please sign in to comment.