forked from upciti/wakemeops
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (97 loc) · 2.81 KB
/
check_blueprints.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
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
name: 🧐 Check blueprints
on:
pull_request:
jobs:
changes:
runs-on: ubuntu-latest
outputs:
ops2deb: ${{ steps.filter.outputs.ops2deb }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ops2deb:
- 'blueprints/**'
- name: Clean up labels
uses: actions-ecosystem/action-remove-labels@v1
if: success()
with:
labels: |
build failed
tests failed
fail_on_error: false
build_packages:
needs: [changes]
if: ${{ needs.changes.outputs.ops2deb == 'true' }}
runs-on: ubuntu-latest
container:
image: ghcr.io/upciti/ops2deb:latest
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Print ops2deb version
run: ops2deb version
- name: Validate configuration files
run: make format
- name: Generate new Debian packages
shell: bash
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
MODIFIED=$(git diff --name-only HEAD~1 HEAD -- ./blueprints 2>/dev/null)
export COMPONENTS=$(echo $MODIFIED | cut -d"/" -f2 | uniq)
export OPS2DEB_ONLY_BLUEPRINTS=$(echo $MODIFIED | cut -d"/" -f3 | uniq)
make build
- name: Set build failed label on failure
uses: actions-ecosystem/action-add-labels@v1
if: failure()
with:
labels: build failed
- name: Upload Debian packages
uses: actions/upload-artifact@v4
with:
path: build/**/*deb
retention-days: 2
test_packages:
needs: [build_packages]
runs-on: ubuntu-latest
strategy:
matrix:
distribution:
- debian:bookworm-slim
- minideb:bookworm
- minideb:bullseye
- ubuntu:rolling
- ubuntu:22.04
- ubuntu:20.04
container: wakemeops/${{ matrix.distribution }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Debian packages
uses: actions/download-artifact@v4
with:
path: build
- name: Install make
run: install_packages make
- name: Test packages
run: |
make install-packages
make check-packages
- name: Set tests failed label on failure
uses: actions-ecosystem/action-add-labels@v1
if: failure()
with:
labels: tests failed
test_packages_success:
runs-on: ubuntu-latest
needs: [test_packages, build_packages]
if: always()
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
none_of: build failed,tests failed
repo_token: ${{ secrets.GITHUB_TOKEN }}