From aa424955600e0cedaa1956b19f4e4b6550a89ea7 Mon Sep 17 00:00:00 2001 From: Mathew Richmond Date: Thu, 12 Oct 2023 09:48:40 -0600 Subject: [PATCH] Build overhaul . --- .github/workflows/audit.yml | 3 +++ .github/workflows/build.yml | 19 +++++++++---------- .github/workflows/build_arm_nix.yml | 6 +----- .github/workflows/build_nix.yml | 6 ++++++ .github/workflows/careful.yml | 6 ++++++ .github/workflows/coverage.yml | 6 ++++++ .github/workflows/doc.yml | 14 +++++--------- .github/workflows/lints.yml | 26 +++++++++++++++----------- .github/workflows/update_nix.yml | 5 +++++ 9 files changed, 56 insertions(+), 35 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 611a84156d..4eeeb80d14 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,6 +1,9 @@ name: Run Cargo Audit on: + push: + branches: + - 'main' schedule: - cron: '0 0 * * 1' # Run on Mondays workflow_dispatch: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e387389168..2e9959727d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,33 +6,32 @@ 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/cancel-workflow-action@0.11.0 - name: Cancel Outdated Builds + - name: Cancel Outdated Builds + uses: styfle/cancel-workflow-action@0.11.0 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: | diff --git a/.github/workflows/build_arm_nix.yml b/.github/workflows/build_arm_nix.yml index 44878cdefe..e07579b6a2 100644 --- a/.github/workflows/build_arm_nix.yml +++ b/.github/workflows/build_arm_nix.yml @@ -5,9 +5,6 @@ on: branches: - 'main' pull_request: - branches: - - 'main' - - '*/*' schedule: - cron: '0 0 * * 1' workflow_dispatch: @@ -36,5 +33,4 @@ jobs: # 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 diff --git a/.github/workflows/build_nix.yml b/.github/workflows/build_nix.yml index a98c9ae2b4..bb942f4f30 100644 --- a/.github/workflows/build_nix.yml +++ b/.github/workflows/build_nix.yml @@ -19,6 +19,12 @@ 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 diff --git a/.github/workflows/careful.yml b/.github/workflows/careful.yml index 9ccdb955bf..35a3e71cf4 100644 --- a/.github/workflows/careful.yml +++ b/.github/workflows/careful.yml @@ -14,6 +14,12 @@ 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 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5dd6b32725..91bc1e1f00 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,6 +18,12 @@ 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 diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index bb6f576711..b823e7939f 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -4,9 +4,6 @@ on: branches: - 'main' pull_request: - branches: - - 'main' - - '*/*' schedule: - cron: '0 0 * * 1' workflow_dispatch: @@ -16,8 +13,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 35 steps: - - uses: styfle/cancel-workflow-action@0.11.0 - name: Cancel Outdated Builds + - name: Cancel Outdated Builds + uses: styfle/cancel-workflow-action@0.11.0 with: all_but_latest: true access_token: ${{ github.token }} @@ -31,12 +28,11 @@ jobs: sudo apt-get install -y protobuf-compiler cargo install just - - uses: Swatinem/rust-cache@v2 - name: Enable Rust Caching + - 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' }} diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 9ab7bf8c03..1c8a319e04 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -5,9 +5,6 @@ on: branches: - 'main' pull_request: - branches: - - 'main' - - '*/*' workflow_dispatch: jobs: @@ -15,8 +12,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 25 steps: - - uses: styfle/cancel-workflow-action@0.11.0 - name: Cancel Outdated Builds + - name: Cancel Outdated Builds + uses: styfle/cancel-workflow-action@0.11.0 with: all_but_latest: true access_token: ${{ github.token }} @@ -24,13 +21,20 @@ jobs: - 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 + - name: Clippy async_std + run: nix develop -c just async_std lint + + - name: Clippy tokio + run: nix develop -c just tokio lint diff --git a/.github/workflows/update_nix.yml b/.github/workflows/update_nix.yml index 139d6d3334..82a8bda893 100644 --- a/.github/workflows/update_nix.yml +++ b/.github/workflows/update_nix.yml @@ -17,6 +17,11 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - 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: