Skip to content

Commit

Permalink
Build overhaul
Browse files Browse the repository at this point in the history
.
  • Loading branch information
Ancient123 committed Oct 12, 2023
1 parent b5c6026 commit 3f95de9
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Run Cargo Audit

on:
push:
branches:
- 'main'
schedule:
- cron: '0 0 * * 1' # Run on Mondays
workflow_dispatch:
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,43 @@ on:
- 'benchmarking_*'
- 'main'
pull_request:
branches:
- 'main'
- '*/*'
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
just_variants:
- async_std
- tokio
runs-on: ubuntu-latest

steps:
- uses: styfle/[email protected]
name: Cancel Outdated Builds
- name: Cancel Outdated Builds
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v4
name: Checkout Repository
- name: Checkout Repository
uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
cargo install just
- name: Install Just
run: |
wget https://github.com/casey/just/releases/download/1.14.0/just-1.14.0-x86_64-unknown-linux-musl.tar.gz
tar -vxf just-1.14.0-x86_64-unknown-linux-musl.tar.gz just
sudo cp just /usr/bin/just
- name: Check
run: just ${{ matrix.just_variants }} check
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build_arm_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches:
- 'main'
pull_request:
branches:
- 'main'
- '*/*'
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
Expand All @@ -34,7 +31,10 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

# See how long just nix setup takes
- name: Initialize nix
run: nix develop -c echo Finished

# sanity check that repository builds with nix
- name: Build
run: |
nix develop -c just async_std build
run: nix develop -c just async_std build
13 changes: 11 additions & 2 deletions .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@v23

- name: Nix Caching
uses: cachix/cachix-action@v12
with:
name: espresso-systems-private
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Checkout Repository
uses: actions/checkout@v4

# See how long just nix setup takes
- name: Initialize nix
run: nix develop -c echo Finished

# sanity check that repository builds with nix
- name: Build
run: |
nix develop -c just async_std build
run: nix develop -c just async_std build
16 changes: 16 additions & 0 deletions .github/workflows/careful.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,28 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Cancel Outdated Builds
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}

- name: Install Nix
uses: cachix/install-nix-action@v23

- name: Nix Caching
uses: cachix/cachix-action@v12
with:
name: espresso-systems-private
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Checkout Repository
uses: actions/checkout@v4

# See how long just nix setup takes
- name: Initialize nix
run: nix develop -c echo Finished

- name: Run careful tests
run: |
nix develop .#correctnessShell -c just tokio careful
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@v23

- name: Nix Caching
uses: cachix/cachix-action@v12
with:
name: espresso-systems-private
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Checkout Repository
uses: actions/checkout@v4

# See how long just nix setup takes
- name: Initialize nix
run: nix develop -c echo Finished

- name: Generate coverage reports
# Use the `release` profile rather than `release-lto` as other workflows do, since `--
# profile=release-lto` will cause the `failed to generate report` error.
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
branches:
- 'main'
pull_request:
branches:
- 'main'
- '*/*'
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
Expand All @@ -16,8 +13,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- uses: styfle/[email protected]
name: Cancel Outdated Builds
- name: Cancel Outdated Builds
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}
Expand All @@ -29,14 +26,18 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
cargo install just
- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
- name: Install Just
run: |
wget https://github.com/casey/just/releases/download/1.14.0/just-1.14.0-x86_64-unknown-linux-musl.tar.gz
tar -vxf just-1.14.0-x86_64-unknown-linux-musl.tar.gz just
sudo cp just /usr/bin/just
- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2

- name: Build Docs
run: |
just async_std doc
run: just async_std doc

- name: Create documentation
if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,40 @@ on:
branches:
- 'main'
pull_request:
branches:
- 'main'
- '*/*'
workflow_dispatch:

jobs:
lints:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: styfle/[email protected]
name: Cancel Outdated Builds
- name: Cancel Outdated Builds
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}

- name: Install Nix
uses: cachix/install-nix-action@v23

- uses: actions/checkout@v4
name: Checkout Repository
- name: Nix Caching
uses: cachix/cachix-action@v12
with:
name: espresso-systems-private
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Checkout Repository
uses: actions/checkout@v4

- name: Format Check
run: cargo fmt -- --check

- name: Clippy
run: |
nix develop -c just async_std lint
nix develop -c just tokio lint
# See how long just nix setup takes
- name: Initialize nix
run: nix develop -c echo Finished

- name: Clippy async_std
run: nix develop -c just async_std lint

- name: Clippy tokio
run: nix develop -c just tokio lint
6 changes: 6 additions & 0 deletions .github/workflows/update_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ jobs:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Nix Caching
uses: cachix/cachix-action@v12
with:
name: espresso-systems-private
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v20
with:
Expand Down

0 comments on commit 3f95de9

Please sign in to comment.