Skip to content

Commit 873ab5d

Browse files
committed
Merge branch 'workflows' into stable-0.11.y
Signed-off-by: Martin Wilck <mwilck@suse.com>
2 parents bfca0c0 + 7177fa0 commit 873ab5d

11 files changed

Lines changed: 388 additions & 232 deletions

.github/workflows/abi-stable.yaml

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,48 @@ jobs:
2121
run: >
2222
echo ${{ github.ref }} |
2323
sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV
24-
if: ${{ github.event_name == 'push' }}
24+
if: github.event_name == 'push'
2525
- name: get parent tag (PR)
2626
run: >
2727
echo ${{ github.base_ref }} |
2828
sed -E 's,stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV
29-
if: ${{ github.event_name == 'pull_request' }}
29+
if: github.event_name == 'pull_request'
3030
- name: assert parent tag
3131
run: /bin/false
32-
if: ${{ env.PARENT_TAG == '' }}
32+
if: env.PARENT_TAG == ''
33+
- name: try to download ABI for ${{ env.PARENT_TAG }}
34+
id: download_abi
35+
continue-on-error: true
36+
uses: dawidd6/action-download-artifact@v21
37+
with:
38+
workflow: abi-stable.yaml
39+
workflow_conclusion: ''
40+
branch: ${{ github.ref_name }}
41+
name: multipath-abi-${{ env.PARENT_TAG }}
42+
search_artifacts: true
43+
path: __unused__
3344
- name: update
45+
if: steps.download_abi.outcome != 'success'
3446
run: sudo apt-get update
3547
- name: dependencies
48+
if: steps.download_abi.outcome != 'success'
3649
run: >
3750
sudo apt-get install --yes gcc
3851
gcc make pkg-config abigail-tools
3952
libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev
4053
libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev
4154
libmount-dev
4255
- name: checkout ${{ env.PARENT_TAG }}
43-
uses: actions/checkout@v4
56+
if: steps.download_abi.outcome != 'success'
57+
uses: actions/checkout@v7
4458
with:
4559
ref: ${{ env.PARENT_TAG }}
4660
- name: build ABI for ${{ env.PARENT_TAG }}
61+
if: steps.download_abi.outcome != 'success'
4762
run: make -j$(nproc) -Orecurse abi
4863
- name: save ABI
49-
uses: actions/upload-artifact@v4
64+
if: steps.download_abi.outcome != 'success'
65+
uses: actions/upload-artifact@v7
5066
with:
5167
name: multipath-abi-${{ env.PARENT_TAG }}
5268
path: abi
@@ -59,28 +75,31 @@ jobs:
5975
run: >
6076
echo ${{ github.ref }} |
6177
sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV
62-
if: ${{ github.event_name == 'push' }}
78+
if: github.event_name == 'push'
6379
- name: get parent tag (PR)
6480
run: >
6581
echo ${{ github.base_ref }} |
6682
sed -E 's,stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV
67-
if: ${{ github.event_name == 'pull_request' }}
83+
if: github.event_name == 'pull_request'
6884
- name: assert parent tag
6985
run: /bin/false
70-
if: ${{ env.PARENT_TAG == '' }}
86+
if: env.PARENT_TAG == ''
7187
- name: checkout ${{ github.ref }}
72-
uses: actions/checkout@v4
88+
uses: actions/checkout@v7
7389
with:
7490
ref: ${{ github.ref }}
7591
- name: download ABI for ${{ env.PARENT_TAG }}
7692
id: download_abi
77-
uses: actions/download-artifact@v4
93+
uses: dawidd6/action-download-artifact@v21
7894
with:
95+
workflow: abi-stable.yaml
96+
workflow_conclusion: ''
97+
branch: ${{ github.ref_name }}
7998
name: multipath-abi-${{ env.PARENT_TAG }}
99+
search_artifacts: true
80100
path: reference-abi
81101
- name: update
82102
run: sudo apt-get update
83-
if: steps.download_abi.outcome != 'success'
84103
- name: dependencies
85104
run: >
86105
sudo apt-get install --yes gcc
@@ -93,8 +112,8 @@ jobs:
93112
run: make -j$(nproc) -Orecurse abi-test
94113
continue-on-error: true
95114
- name: save differences
96-
if: ${{ steps.check_abi.outcome != 'success' }}
97-
uses: actions/upload-artifact@v4
115+
if: steps.check_abi.outcome != 'success'
116+
uses: actions/upload-artifact@v7
98117
with:
99118
name: abi-test
100119
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: 73 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,29 +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: dbhi/qus/action@main
81+
uses: docker/setup-qemu-action@v4
82+
with:
83+
image: tonistiigi/binfmt:latest
84+
- name: Set coredump pattern
85+
run: |
86+
echo 'core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
8287
- name: run tests
83-
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
84107
with:
85-
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
86-
guest-dir: /__w/multipath-tools/multipath-tools
87-
host-dir: ${{ github.workspace }}
88-
command: -C tests
89-
params: >
90-
--workdir /__w/multipath-tools/multipath-tools
91-
--platform linux/${{ env.CONTAINER_ARCH }}
92-
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'
93115

94116
root-test:
95117
runs-on: ubuntu-24.04
@@ -111,35 +133,51 @@ jobs:
111133
run: sudo modprobe brd rd_nr=1 rd_size=65536
112134
- name: set container arch
113135
run: echo CONTAINER_ARCH="${{ matrix.arch }}" >> $GITHUB_ENV
114-
if: ${{ matrix.arch != 'armhf' }}
136+
if: matrix.arch != 'armhf'
115137
- name: set container arch
116138
run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV
117-
if: ${{ matrix.arch == 'armhf' }}
139+
if: matrix.arch == 'armhf'
118140
- name: download binary archive
119-
uses: actions/download-artifact@v4
141+
uses: actions/download-artifact@v8
120142
with:
121143
name: cross-${{ matrix.os }}-${{ matrix.arch }}
122144
- name: unpack binary archive
123145
run: tar xfv test-progs.tar
124146
- name: enable foreign arch
125-
uses: dbhi/qus/action@main
126-
- name: run tests
127-
uses: mosteo-actions/docker-run@v1
147+
uses: docker/setup-qemu-action@v4
128148
with:
129-
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
130-
guest-dir: /__w/multipath-tools/multipath-tools
131-
host-dir: ${{ github.workspace }}
132-
command: -C tests dmevents.out
133-
params: >
134-
--workdir /__w/multipath-tools/multipath-tools
135-
--platform linux/${{ env.CONTAINER_ARCH }}
136-
--privileged
137-
-v /dev/ram0:/dev/ram0 -e DIO_TEST_DEV=/dev/ram0
138-
pull-params: "--platform linux/${{ env.CONTAINER_ARCH }}"
149+
image: tonistiigi/binfmt:latest
150+
- name: Set coredump pattern
151+
run: |
152+
echo 'core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
153+
- name: run tests
139154
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
140166
continue-on-error: true
141-
- name: show root test output
142-
run: for o in tests/*.out; do echo "===== $o ====="; cat "$o"; done
143-
- 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
144182
run: /bin/false
145-
if: ${{ steps.root-test.outcome == 'failure' }}
183+
if: steps.root-test.outcome != 'success'

0 commit comments

Comments
 (0)