Skip to content

Commit

Permalink
ci: rename workflows set concurrency and needs
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoporto committed Jan 20, 2025
1 parent 931ca8e commit a70ca9f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ on:
types: [synchronize, opened, reopened, ready_for_review, converted_to_draft]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: check-docs_${{ github.workflow }}_${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check_docs:
name: Check Docs
runs-on: ubuntu-latest

steps:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Checks

on:
workflow_call:
push:
branches: [main]
pull_request:
Expand All @@ -11,9 +12,13 @@ on:
ready_for_review, # PR was converted from draft to open
converted_to_draft, # PR was converted from open to draft
]

concurrency:
group: checks_${{ github.workflow }}_${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
checks:
name: Run Checks
runs-on: ubuntu-latest

steps:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ permissions:
id-token: write

jobs:
checks:
uses: ./.github/workflows/checks.yml
secrets: inherit

unit_tests:
uses: ./.github/workflows/unit-tests.yml
secrets: inherit

deploy:
name: Generate Build and Deploy to GitHub Pages
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
name: Generate Build and Deploy to GitHub Pages
needs: [checks, unit_tests]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
name: Release
on: workflow_dispatch

permissions:
contents: read # for checkout
on: workflow_dispatch

jobs:
checks:
uses: ./.github/workflows/checks.yml
secrets: inherit

unit_tests:
uses: ./.github/workflows/unit-tests.yml
secrets: inherit

release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

needs: [checks]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v4
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml → .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Tests
name: Unit Tests

on:
workflow_call:
push:
branches: [main]
pull_request:
Expand All @@ -11,9 +12,13 @@ on:
ready_for_review, # PR was converted from draft to open
converted_to_draft, # PR was converted from open to draft
]

concurrency:
group: unit-tests_${{ github.workflow }}_${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Tests
unit_tests:
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit a70ca9f

Please sign in to comment.