-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.14 KB
/
pull_request.yml
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
name: Checks
on:
pull_request:
branches:
- master
workflow_dispatch:
jobs:
check_def_changed: # evaluate whether build needs to be run / cache updated
name: Container Changed
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.check_file.outputs.changed }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if file changed
id: check_file
shell: bash
run: |
if [[ $(git diff --name-only origin/master...HEAD -- 'resources/retinal-rl.def') ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
less $GITHUB_OUTPUT
ensure_container: # main cache should provide the container if def file not changed
name: Rebuild container
needs: check_def_changed
if: needs.check_def_changed.outputs.changed == 'true'
uses: ./.github/workflows/update_cache.yml
with:
build: true
checks:
name: Code Checks
needs: ensure_container
if: always()
uses: ./.github/workflows/code_check.yml