From b54fa5d513bbc42153f32b61ed5a330086618f4b Mon Sep 17 00:00:00 2001 From: "C.Lee Taylor" Date: Tue, 20 Aug 2024 16:32:12 +0200 Subject: [PATCH] ci(limit): reduce CI usage on private repo --- .github/workflows/audit.yml | 13 ++++++++++--- .github/workflows/build_binaries.yml | 4 ++-- .github/workflows/ci.yml | 6 ++++-- .github/workflows/pr_title.yml | 7 +++++-- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 1fffef0..e7145d4 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,5 +1,5 @@ --- -name: Security audit - daily +name: Security audit - monthly 'on': push: @@ -13,10 +13,17 @@ name: Security audit - daily - '**/audit.toml' # Rerun periodicly to pick up new advisories schedule: - - cron: '43 05 * * *' + - cron: '43 05 01 * *' # Run manually workflow_dispatch: +concurrency: + # https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/main' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }} + +permissions: {} + jobs: security_audit: runs-on: ubuntu-latest @@ -24,4 +31,4 @@ jobs: - uses: actions/checkout@v4 - uses: rustsec/audit-check@v1.4.1 with: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build_binaries.yml b/.github/workflows/build_binaries.yml index 7bc78da..8e7987e 100644 --- a/.github/workflows/build_binaries.yml +++ b/.github/workflows/build_binaries.yml @@ -9,7 +9,7 @@ name: Build Matrix of Binaries - "build-all-*" - "build-bins-*" schedule: - - cron: "05 00 * * *" + - cron: "05 00 01 * *" workflow_dispatch: env: @@ -31,7 +31,7 @@ env: concurrency: # https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }} + cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/main' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }} permissions: contents: read diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e38dc4..3e38407 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,6 @@ name: CI 'on': - workflow_dispatch: push: branches: - "ci-*" @@ -12,6 +11,7 @@ name: CI - reopened - synchronize merge_group: + workflow_dispatch: env: toolchain: nightly-2024-07-07 @@ -27,7 +27,9 @@ env: concurrency: # https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }} + cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/main' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }} + +permissions: {} jobs: clippy: diff --git a/.github/workflows/pr_title.yml b/.github/workflows/pr_title.yml index ae85f6b..4bf2c8b 100644 --- a/.github/workflows/pr_title.yml +++ b/.github/workflows/pr_title.yml @@ -12,8 +12,11 @@ name: PR - synchronize concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }} + +permissions: {} jobs: check-title: