-
Notifications
You must be signed in to change notification settings - Fork 865
135 lines (128 loc) · 3.95 KB
/
dev.yml
File metadata and controls
135 lines (128 loc) · 3.95 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Dev
on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
- backport/*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
any_src_changed: ${{ steps.src.outputs.any_changed }}
bendpy_changed: ${{ steps.bendpy.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Source File Changes
uses: tj-actions/changed-files@v46
id: src
with:
files_ignore: |
.github/**
**.md
benchmark/**
docker/**
scripts/setup/**
scripts/distribution/**
.devcontainer/**
- name: Check Bendpy File Changes
uses: tj-actions/changed-files@v46
id: bendpy
with:
files: |
src/bendpy/**
- name: Output Source File Changes
run: |
if [[ "${{ steps.src.outputs.any_changed }}" == "true" ]]; then
echo "these src files changed:" >> $GITHUB_STEP_SUMMARY
for line in ${{ steps.src.outputs.all_changed_files }}; do
echo "- $line" >> $GITHUB_STEP_SUMMARY
done
else
echo "no src file changes detected" >> $GITHUB_STEP_SUMMARY
fi
linux:
needs: changes
if: needs.changes.outputs.any_src_changed == 'true'
uses: ./.github/workflows/reuse.linux.yml
secrets: inherit
with:
build_profile: ci
runner_provider: aws
runner_arch: ARM64
license_type: trial
mac_check:
needs: changes
if: needs.changes.outputs.any_src_changed == 'true'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/check_macos
timeout-minutes: 60
test_bendpy:
needs: changes
if: needs.changes.outputs.bendpy_changed == 'true'
runs-on:
- self-hosted
- ARM64
- Linux
- 4c
- aws
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/build_bindings_python
timeout-minutes: 30
with:
target: aarch64-unknown-linux-gnu
ready:
if: always()
runs-on: ubuntu-latest
needs:
- changes
- linux
- mac_check
- test_bendpy
steps:
- name: Check Ready to Merge
uses: actions/github-script@v7
env:
SRC_CHANGED: ${{ needs.changes.outputs.any_src_changed }}
BENDPY_CHANGED: ${{ needs.changes.outputs.bendpy_changed }}
LINUX_BUILD_RESULT: ${{ needs.linux.result }}
MAC_CHECK_RESULT: ${{ needs.mac_check.result }}
BENDPY_RESULT: ${{ needs.test_bendpy.result }}
with:
script: |
if (process.env.SRC_CHANGED == 'false' && process.env.BENDPY_CHANGED == 'false') {
core.info('No source file changes detected, skipping');
return;
}
if (process.env.BENDPY_CHANGED == 'true' && process.env.BENDPY_RESULT != 'success') {
core.setFailed(`Bendpy tests did not complete successfully (${process.env.BENDPY_RESULT}), not ready to merge`);
return;
}
if (process.env.SRC_CHANGED == 'false') {
core.info('Required bendpy checks succeeded, ready to merge');
return;
}
if (process.env.MAC_CHECK_RESULT != 'success') {
core.setFailed(`macOS check did not complete successfully (${process.env.MAC_CHECK_RESULT}), not ready to merge`);
return;
}
if (process.env.LINUX_BUILD_RESULT == 'success') {
core.info('Linux build and macOS check succeeded, ready to merge');
return;
}
core.setFailed('Build failed, not ready to merge');