Skip to content

Commit 8e1536f

Browse files
committed
ci: add stable aggregate checks
1 parent 5294efc commit 8e1536f

2 files changed

Lines changed: 45 additions & 27 deletions

File tree

.github/workflows/actionlint.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: CI
22

33
on:
44
pull_request:
5-
paths:
6-
- SgfDevs/**
7-
- SgfDevs.Tests/**
8-
- SgfDevs.slnx
9-
- .github/workflows/**
105
push:
116
branches:
127
- main
@@ -20,7 +15,30 @@ permissions:
2015
contents: read
2116

2217
jobs:
18+
changes:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
application: ${{ steps.changed-files.outputs.application_any_changed }}
22+
workflows: ${{ steps.changed-files.outputs.workflows_any_changed }}
23+
steps:
24+
- uses: actions/checkout@v7
25+
26+
- name: Detect relevant changes
27+
id: changed-files
28+
uses: tj-actions/changed-files@v47
29+
with:
30+
files_yaml: |
31+
application:
32+
- SgfDevs/**
33+
- SgfDevs.Tests/**
34+
- SgfDevs.slnx
35+
- .github/workflows/ci.yml
36+
workflows:
37+
- .github/workflows/**
38+
2339
build-and-test:
40+
needs: changes
41+
if: ${{ needs.changes.outputs.application == 'true' }}
2442
runs-on: ubuntu-latest
2543
steps:
2644
- uses: actions/checkout@v7
@@ -37,3 +55,25 @@ jobs:
3755

3856
- name: Test
3957
run: dotnet test SgfDevs.slnx --no-build --verbosity minimal
58+
59+
actionlint:
60+
needs: changes
61+
if: ${{ needs.changes.outputs.workflows == 'true' }}
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v7
65+
- uses: raven-actions/actionlint@v2
66+
67+
result:
68+
name: CI checks
69+
if: ${{ always() && github.event_name == 'pull_request' }}
70+
needs:
71+
- changes
72+
- build-and-test
73+
- actionlint
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
77+
with:
78+
allowed-skips: build-and-test, actionlint
79+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)