Skip to content

Commit

Permalink
chore: modernize CI (whisperfish#240)
Browse files Browse the repository at this point in the history
* chore: modernize CI

* use dtolnay/rust-toolchain
* upgrade actions/checkout to v4
* only install protobuf-compiler

* fix

* remove locked since this is a lib

* remove audit workflow: replaced by dependabot
  • Loading branch information
boxdot authored Mar 1, 2024
1 parent 7169fa4 commit be7cdee
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 48 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/audit.yml

This file was deleted.

42 changes: 13 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,82 +25,66 @@ jobs:
RUSTFLAGS: -D warnings
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable

- name: Install protobuf
run: |
sudo apt-get update
sudo apt-get install -y libprotobuf-dev libprotobuf-c-dev protobuf-compiler protobuf-c-compiler
sudo apt-get install -y protobuf-compiler
- name: Configure CI cache
uses: Swatinem/rust-cache@v2

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

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets ${{ matrix.cargo_flags }}
run: cargo test --all-targets ${{ matrix.cargo_flags }}

- name: Test docs
uses: actions-rs/cargo@v1
with:
command: test
args: --doc ${{ matrix.cargo_flags }}
run: cargo test --doc ${{ matrix.cargo_flags }}

rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt

- name: Check code format
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt -- --check

clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy

- name: Install protobuf
run: |
sudo apt-get update
sudo apt-get install -y libprotobuf-dev libprotobuf-c-dev protobuf-compiler protobuf-c-compiler
sudo apt-get install -y protobuf-compiler
- name: Setup CI cache
uses: Swatinem/rust-cache@v2

- name: Run clippy lints
uses: actions-rs/cargo@v1
with:
command: clippy
run: cargo clippy
11 changes: 6 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ jobs:
name: Update
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install protobuf
run: |
sudo apt-get update
sudo apt-get install -y libprotobuf-dev libprotobuf-c-dev protobuf-compiler protobuf-c-compiler
- uses: actions-rs/cargo@v1
sudo apt-get install -y protobuf-compiler
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
command: doc
args: --all-features --no-deps -p presage -p libsignal-service -p libsignal-service-hyper -p libsignal-protocol -p zkgroup
toolchain: stable
- run: cargo doc --all-features --no-deps -p presage -p libsignal-service -p libsignal-service-hyper -p libsignal-protocol -p zkgroup
- uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit be7cdee

Please sign in to comment.