Repository navigation
89 lines (78 loc) · 3.49 KB
/
Copy pathbuilds.yml
File metadata and controls
89 lines (78 loc) · 3.49 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: 🖥️ Builds
on:
push:
branches: ['master']
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}|${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: {}
jobs:
static-checks-builds:
name: 📊 Code style, file formatting, and docs
runs-on: ubuntu-latest
if: github.run_attempt > 1 || github.event_name == 'workflow_dispatch' || !vars.DISABLE_BUILDS
outputs:
changed-files: '"${{ steps.changed-files.outputs.clangd_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators.
sources-changed: ${{ steps.changed-files.outputs.sources_any_changed }}
steps:
- name: Checkout project
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
fetch-depth: 0 # Treeless clone. Slightly less performant than a shallow clone, but makes finding diffs instantaneous.
filter: tree:0 # See: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
persist-credentials: false
- name: Install APT dependencies
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
with:
packages: libxml2-utils
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
with:
safe_output: false # Output passed to environment variable to avoid command injection.
separator: '" "' # To account for paths with spaces, ensure our items are split by quotes internally.
skip_initial_fetch: true
files_yaml_from_source_file: .github/changed-files.yml
- name: Style checks via prek
if: steps.changed-files.outputs.pre-commit-config_any_changed != 'true'
uses: j178/prek-action@1382ad72dea72f9d53832f2bcb65b3e87a947204 # v3.0.1
env:
CHANGED_FILES: '"${{ steps.changed-files.outputs.pre-commit_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators
with:
extra-args: --files ${{ env.CHANGED_FILES }}
- name: Style checks via prek for all files
if: steps.changed-files.outputs.pre-commit-config_any_changed == 'true'
uses: j178/prek-action@1382ad72dea72f9d53832f2bcb65b3e87a947204 # v3.0.1
build-master:
name: 🛠️ Build
needs: static-checks-builds
if: needs.static-checks-builds.outputs.sources-changed == 'true' || github.event_name != 'pull_request'
permissions:
contents: read
uses: ./.github/workflows/build-matrix.yml
merge-library-files:
name: 📚 Merge Library Files
runs-on: ubuntu-latest
needs: build-master
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
delete-merged: true
name: ${{ github.event.repository.name }}-library
pattern: ${{ github.event.repository.name }}-*-library
validate-master:
name: ✅ Validate Success
if: always()
needs: [static-checks-builds, build-master, merge-library-files]
runs-on: Ubuntu-latest
steps:
- name: Check
uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35
with:
allowed-skips: static-checks-builds, build-master, merge-library-files
jobs: ${{ toJson(needs) }}