Repository navigation
73 lines (66 loc) · 1.93 KB
/
Copy pathci.yml
File metadata and controls
73 lines (66 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Runs every check on pull requests, pushes to main, and once a week. Each
# sample's workflow skips its jobs when the sample didn't change.
# "All checks passed" sums up the results and is the one check to require.
name: CI
on:
pull_request:
push:
branches: [main]
schedule:
- cron: "23 7 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
workflows:
name: Workflows
uses: ./.github/workflows/workflows.yml
codeql:
name: CodeQL
uses: ./.github/workflows/codeql.yml
permissions:
actions: read
contents: read
security-events: write
foldersync:
name: FolderSync
uses: ./.github/workflows/foldersync.yml
all-passed:
name: All checks passed
if: always()
needs: [workflows, codeql, foldersync]
runs-on: ubuntu-latest
steps:
- env:
WORKFLOWS: ${{ needs.workflows.result }}
CODEQL: ${{ needs.codeql.result }}
FOLDERSYNC: ${{ needs.foldersync.result }}
run: |
icon() {
case "$1" in
success) echo "✅" ;;
skipped) echo "⏭️" ;;
*) echo "❌" ;;
esac
}
{
echo "## CI"
echo
echo "| Check | Result |"
echo "| --- | --- |"
echo "| Workflows (actionlint) | $(icon "$WORKFLOWS") $WORKFLOWS |"
echo "| CodeQL | $(icon "$CODEQL") $CODEQL |"
echo "| FolderSync | $(icon "$FOLDERSYNC") $FOLDERSYNC |"
} >> "$GITHUB_STEP_SUMMARY"
for result in "$WORKFLOWS" "$CODEQL" "$FOLDERSYNC"; do
case "$result" in
success | skipped) ;;
*)
echo "::error::A check didn't pass. See the table in this run's summary."
exit 1
;;
esac
done