Skip to content

Commit 66cfe38

Browse files
committed
Merge branch 'workflows' into stable-0.10.y
Signed-off-by: Martin Wilck <mwilck@suse.com>
2 parents 621cca9 + 7177fa0 commit 66cfe38

11 files changed

Lines changed: 380 additions & 228 deletions

.github/workflows/abi-stable.yaml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,40 @@ jobs:
2121
steps:
2222
- name: assert parent tag
2323
run: /bin/false
24-
if: ${{ env.PARENT_TAG == '' }}
24+
if: env.PARENT_TAG == ''
25+
- name: try to download ABI for ${{ env.PARENT_TAG }}
26+
id: download_abi
27+
continue-on-error: true
28+
uses: dawidd6/action-download-artifact@v21
29+
with:
30+
workflow: abi-stable.yaml
31+
workflow_conclusion: ''
32+
branch: ${{ github.ref_name }}
33+
name: multipath-abi-${{ env.PARENT_TAG }}
34+
search_artifacts: true
35+
path: __unused__
2536
- name: update
37+
if: steps.download_abi.outcome != 'success'
2638
run: sudo apt-get update
2739
- name: dependencies
40+
if: steps.download_abi.outcome != 'success'
2841
run: >
2942
sudo apt-get install --yes gcc
3043
gcc make pkg-config abigail-tools
3144
libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev
3245
libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev
3346
libmount-dev
3447
- name: checkout ${{ env.PARENT_TAG }}
35-
uses: actions/checkout@v4
48+
if: steps.download_abi.outcome != 'success'
49+
uses: actions/checkout@v7
3650
with:
3751
ref: ${{ env.PARENT_TAG }}
3852
- name: build ABI for ${{ env.PARENT_TAG }}
53+
if: steps.download_abi.outcome != 'success'
3954
run: make -j$(nproc) -Orecurse abi
4055
- name: save ABI
41-
uses: actions/upload-artifact@v4
56+
if: steps.download_abi.outcome != 'success'
57+
uses: actions/upload-artifact@v7
4258
with:
4359
name: multipath-abi-${{ env.PARENT_TAG }}
4460
path: abi
@@ -49,20 +65,23 @@ jobs:
4965
steps:
5066
- name: assert parent tag
5167
run: /bin/false
52-
if: ${{ env.PARENT_TAG == '' }}
68+
if: env.PARENT_TAG == ''
5369
- name: checkout ${{ github.ref }}
54-
uses: actions/checkout@v4
70+
uses: actions/checkout@v7
5571
with:
5672
ref: ${{ github.ref }}
5773
- name: download ABI for ${{ env.PARENT_TAG }}
5874
id: download_abi
59-
uses: actions/download-artifact@v4
75+
uses: dawidd6/action-download-artifact@v21
6076
with:
77+
workflow: abi-stable.yaml
78+
workflow_conclusion: ''
79+
branch: ${{ github.ref_name }}
6180
name: multipath-abi-${{ env.PARENT_TAG }}
81+
search_artifacts: true
6282
path: reference-abi
6383
- name: update
6484
run: sudo apt-get update
65-
if: steps.download_abi.outcome != 'success'
6685
- name: dependencies
6786
run: >
6887
sudo apt-get install --yes gcc
@@ -75,8 +94,8 @@ jobs:
7594
run: make -j$(nproc) -Orecurse abi-test
7695
continue-on-error: true
7796
- name: save differences
78-
if: ${{ steps.check_abi.outcome != 'success' }}
79-
uses: actions/upload-artifact@v4
97+
if: steps.check_abi.outcome != 'success'
98+
uses: actions/upload-artifact@v7
8099
with:
81100
name: abi-test
82101
path: abi-test

.github/workflows/abi.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: check-abi
22
on:
33
push:
44
branches:
5+
- master
56
- queue
67
- abi
78
paths:
@@ -21,14 +22,14 @@ jobs:
2122
runs-on: ubuntu-24.04
2223
steps:
2324
- name: set ABI branch
24-
if: ${{ env.ABI_BRANCH == '' }}
25+
if: env.ABI_BRANCH == ''
2526
run: echo "ABI_BRANCH=master" >> $GITHUB_ENV
2627
- name: checkout
27-
uses: actions/checkout@v4
28+
uses: actions/checkout@v7
2829
- name: get reference ABI
2930
id: reference
3031
continue-on-error: true
31-
uses: dawidd6/action-download-artifact@v6
32+
uses: dawidd6/action-download-artifact@v21
3233
with:
3334
workflow: abi.yaml
3435
branch: ${{ env.ABI_BRANCH }}
@@ -46,19 +47,19 @@ jobs:
4647
- name: create ABI
4748
run: make -Orecurse -j$(nproc) abi.tar.gz
4849
- name: save ABI
49-
uses: actions/upload-artifact@v4
50+
uses: actions/upload-artifact@v7
5051
with:
5152
name: abi
5253
path: abi
5354
overwrite: true
5455
- name: compare ABI against reference
5556
id: compare
5657
continue-on-error: true
57-
if: ${{ steps.reference.outcome == 'success' }}
58+
if: steps.reference.outcome == 'success'
5859
run: make abi-test
5960
- name: save differences
60-
if: ${{ steps.compare.outcome == 'failure' }}
61-
uses: actions/upload-artifact@v4
61+
if: steps.compare.outcome == 'failure'
62+
uses: actions/upload-artifact@v7
6263
with:
6364
name: abi-test
6465
path: abi-test

.github/workflows/build-and-unittest.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
rl: ['', 'libreadline', 'libedit']
2121
cc: [ gcc, clang ]
2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v7
2424
- name: update
2525
run: sudo apt-get update
2626
- name: dependencies
@@ -43,7 +43,7 @@ jobs:
4343
- name: set optflags
4444
# valgrind doesn't support the dwarf-5 format of clang 14
4545
run: echo OPT='-O2 -gdwarf-4 -fstack-protector-strong' >> $GITHUB_ENV
46-
if: ${{ matrix.cc == 'clang' }}
46+
if: matrix.cc == 'clang'
4747
- name: build
4848
run: >
4949
make -Orecurse -j$(nproc)
@@ -67,6 +67,8 @@ jobs:
6767
run: rm -f tests/dmevents.out tests/directio.out
6868
- name: root-test
6969
run: sudo make DIO_TEST_DEV=/dev/zram$ZRAM test
70+
- name: kpartx-test
71+
run: sudo make -C kpartx test
7072
noble:
7173
runs-on: ubuntu-24.04
7274
strategy:
@@ -75,7 +77,7 @@ jobs:
7577
rl: ['', 'libreadline', 'libedit']
7678
cc: [ gcc, clang ]
7779
steps:
78-
- uses: actions/checkout@v4
80+
- uses: actions/checkout@v7
7981
- name: mpath
8082
run: sudo modprobe dm_multipath
8183
- name: brd
@@ -108,3 +110,5 @@ jobs:
108110
run: rm -f tests/dmevents.out tests/directio.out
109111
- name: root-test
110112
run: sudo make DIO_TEST_DEV=/dev/ram0 test
113+
- name: kpartx-test
114+
run: sudo make -C kpartx test

.github/workflows/codingstyle.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Check coding style
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- queue
8+
- tip
9+
- 'stable-*'
10+
paths:
11+
- '.clang-format'
12+
- '.github/workflows/codingstyle.yaml'
13+
- '**.h'
14+
- '**.c'
15+
pull_request:
16+
branches:
17+
- master
18+
- queue
19+
- 'stable-*'
20+
paths:
21+
- '.clang-format'
22+
- '.github/workflows/codingstyle.yaml'
23+
- '**.h'
24+
- '**.c'
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
stylecheck:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v7
34+
- run: >-
35+
echo "BASEREF=${{ github.event.pull_request.base.sha }}" >>$GITHUB_ENV
36+
if: github.event_name == 'pull_request'
37+
- run: >-
38+
echo "BASEREF=${{ github.event.before }}" >>$GITHUB_ENV
39+
if: github.event_name == 'push'
40+
- run: git fetch --depth=1 origin ${{ env.BASEREF }}
41+
- uses: yshui/git-clang-format-lint@master
42+
with:
43+
base: ${{ env.BASEREF }}

.github/workflows/coverity.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-24.04
1010
steps:
1111
- name: checkout
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v7
1313
- name: dependencies
1414
run: >
1515
sudo apt-get install --yes

.github/workflows/foreign.yaml

Lines changed: 69 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ jobs:
4141
container: ghcr.io/mwilck/multipath-cross-debian_cross-${{ matrix.os }}-${{ matrix.arch }}
4242
steps:
4343
- name: checkout
44-
uses: actions/checkout@v4
44+
uses: actions/checkout@v7
4545
- name: build
4646
run: make -j$(nproc) -Orecurse test-progs.tar
4747
- name: upload binary archive
48-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@v7
4949
with:
5050
name: cross-${{ matrix.os }}-${{ matrix.arch }}
5151
path: test-progs.tar
@@ -67,31 +67,51 @@ jobs:
6767
steps:
6868
- name: set container arch
6969
run: echo CONTAINER_ARCH="${{ matrix.arch }}" >> $GITHUB_ENV
70-
if: ${{ matrix.arch != 'armhf' }}
70+
if: matrix.arch != 'armhf'
7171
- name: set container arch
7272
run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV
73-
if: ${{ matrix.arch == 'armhf' }}
73+
if: matrix.arch == 'armhf'
7474
- name: download binary archive
75-
uses: actions/download-artifact@v4
75+
uses: actions/download-artifact@v8
7676
with:
7777
name: cross-${{ matrix.os }}-${{ matrix.arch }}
7878
- name: unpack binary archive
7979
run: tar xfv test-progs.tar
8080
- name: enable foreign arch
81-
uses: docker/setup-qemu-action@v2
81+
uses: docker/setup-qemu-action@v4
8282
with:
8383
image: tonistiigi/binfmt:latest
84+
- name: Set coredump pattern
85+
run: |
86+
echo 'core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
8487
- name: run tests
85-
uses: mosteo-actions/docker-run@v1
88+
id: test
89+
run: |
90+
docker run \
91+
--pids-limit 4096 \
92+
--workdir /__w/multipath-tools/multipath-tools \
93+
--platform linux/${{ env.CONTAINER_ARCH }} \
94+
-w /__w/multipath-tools/multipath-tools \
95+
-v${{ github.workspace }}:/__w/multipath-tools/multipath-tools \
96+
ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }} -C tests
97+
continue-on-error: true
98+
- name: Make core dumps accessible
99+
run: |
100+
find . \( -name 'core*' \) -print0 | xargs -0 -r sudo chmod a+x
101+
if: steps.test.outcome != 'success'
102+
- name: save test outputs
103+
run: make test-outputs.tar
104+
if: steps.test.outcome != 'success'
105+
- name: upload test outputs
106+
uses: actions/upload-artifact@v7
86107
with:
87-
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
88-
guest-dir: /__w/multipath-tools/multipath-tools
89-
host-dir: ${{ github.workspace }}
90-
command: -C tests
91-
params: >
92-
--workdir /__w/multipath-tools/multipath-tools
93-
--platform linux/${{ env.CONTAINER_ARCH }}
94-
pull-params: "--platform linux/${{ env.CONTAINER_ARCH }}"
108+
name: test-${{ matrix.os }}-${{ matrix.arch }}
109+
path: test-outputs.tar
110+
overwrite: true
111+
if: steps.test.outcome != 'success'
112+
- name: fail if test failed
113+
run: /bin/false
114+
if: steps.test.outcome != 'success'
95115

96116
root-test:
97117
runs-on: ubuntu-24.04
@@ -113,37 +133,51 @@ jobs:
113133
run: sudo modprobe brd rd_nr=1 rd_size=65536
114134
- name: set container arch
115135
run: echo CONTAINER_ARCH="${{ matrix.arch }}" >> $GITHUB_ENV
116-
if: ${{ matrix.arch != 'armhf' }}
136+
if: matrix.arch != 'armhf'
117137
- name: set container arch
118138
run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV
119-
if: ${{ matrix.arch == 'armhf' }}
139+
if: matrix.arch == 'armhf'
120140
- name: download binary archive
121-
uses: actions/download-artifact@v4
141+
uses: actions/download-artifact@v8
122142
with:
123143
name: cross-${{ matrix.os }}-${{ matrix.arch }}
124144
- name: unpack binary archive
125145
run: tar xfv test-progs.tar
126146
- name: enable foreign arch
127-
uses: docker/setup-qemu-action@v2
147+
uses: docker/setup-qemu-action@v4
128148
with:
129149
image: tonistiigi/binfmt:latest
150+
- name: Set coredump pattern
151+
run: |
152+
echo 'core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
130153
- name: run tests
131-
uses: mosteo-actions/docker-run@v1
132-
with:
133-
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
134-
guest-dir: /__w/multipath-tools/multipath-tools
135-
host-dir: ${{ github.workspace }}
136-
command: -C tests dmevents.out
137-
params: >
138-
--workdir /__w/multipath-tools/multipath-tools
139-
--platform linux/${{ env.CONTAINER_ARCH }}
140-
--privileged
141-
-v /dev/ram0:/dev/ram0 -e DIO_TEST_DEV=/dev/ram0
142-
pull-params: "--platform linux/${{ env.CONTAINER_ARCH }}"
143154
id: root-test
155+
run: |
156+
docker run \
157+
--workdir /__w/multipath-tools/multipath-tools \
158+
--pids-limit 4096 \
159+
--platform linux/${{ env.CONTAINER_ARCH }} \
160+
--privileged \
161+
-v /dev/ram0:/dev/ram0 -e DIO_TEST_DEV=/dev/ram0 \
162+
-w /__w/multipath-tools/multipath-tools \
163+
-v${{ github.workspace }}:/__w/multipath-tools/multipath-tools \
164+
ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }} \
165+
-C tests dmevents.out
144166
continue-on-error: true
145-
- name: show root test output
146-
run: for o in tests/*.out; do echo "===== $o ====="; cat "$o"; done
147-
- name: fail
167+
- name: Make core dumps accessible
168+
run: |
169+
find . \( -name 'core*' \) -print0 | xargs -0 -r sudo chmod a+x
170+
if: steps.root-test.outcome != 'success'
171+
- name: save test outputs
172+
run: make test-outputs.tar
173+
if: steps.root-test.outcome != 'success'
174+
- name: upload test outputs
175+
uses: actions/upload-artifact@v7
176+
with:
177+
name: root-test-${{ matrix.os }}-${{ matrix.arch }}
178+
path: test-outputs.tar
179+
overwrite: true
180+
if: steps.root-test.outcome != 'success'
181+
- name: fail if root test failed
148182
run: /bin/false
149-
if: ${{ steps.root-test.outcome == 'failure' }}
183+
if: steps.root-test.outcome != 'success'

0 commit comments

Comments
 (0)