* [PATCH] erofs-utils: introduce GitHub Actions CI
@ 2024-01-20 15:25 Yifan Zhao
2024-01-21 3:33 ` Gao Xiang
0 siblings, 1 reply; 2+ messages in thread
From: Yifan Zhao @ 2024-01-20 15:25 UTC (permalink / raw)
To: linux-erofs; +Cc: Yifan Zhao
This commit introduces a new CI workflow configuration designed to
automate the testing process for erofs-utils. This CI is based on the
free GitHub Actions for we have a fork in GitHub. The CI will be
triggered on every push to the {main,dev,experimental} branch.
Currently, we have only a simple test for ensuring the correctness of
mkfs.erofs, which covers a small subset of its extended options
including dedupe, fragments, ztailpacking and {lz4,lz4hc,deflate}
compression algorithms. It creates a EROFS image using Linux v6.7 source
code as the workload, then extracts it using fsck.erofs and compares the
sha256sum of the extracted files with the original ones.
Signed-off-by: Yifan Zhao <zhaoyifan@sjtu.edu.cn>
---
Hi forks,
I believe it's time to introduce a CI for erofs-utils, which could help
us to ensure the correctness of the code and avoid regressions.
Currently this simple CI covers only a limited subset of mkfs.erofs as
the commit message says, but more tests could be added in the future,
including:
- LZMA compression (which is not supported for static-linking issue)
- potential compression/dedupe rate regression ([1] is such a case)
- CI for fsck, dump and erofsfuse
An CI demo is available at [2]. In fact, problems (maybe) have been
found in [3] with deflate compression algorithm with the help of this CI.
I will take a look at this later.
[1] https://lore.kernel.org/linux-erofs/20240115150550.1961455-1-hsiangkao@linux.alibaba.com/T/#u
[2] https://github.com/SToPire/erofs-utils-citest/actions/runs/7595077242
[3] https://github.com/SToPire/erofs-utils-citest/actions/runs/7595102798
.github/workflow/ci.yml | 92 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 .github/workflow/ci.yml
diff --git a/.github/workflow/ci.yml b/.github/workflow/ci.yml
new file mode 100644
index 0000000..784166f
--- /dev/null
+++ b/.github/workflow/ci.yml
@@ -0,0 +1,92 @@
+name: erofs-utils CI
+
+on:
+ push:
+ branches:
+ - master
+ - dev
+ - experimental
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: checkout erofs-utils
+ uses: actions/checkout@v4
+ with:
+ path: 'erofs-utils'
+
+ - name: autogen erofs-utils
+ working-directory: ./erofs-utils/
+ run: ./autogen.sh
+
+ - name: configure erofs-utils
+ working-directory: ./erofs-utils/
+ run: ./configure --enable-debug
+ --prefix=${{ github.workspace }}/erofs-utils-install/
+
+ - name: make and install erofs-utils
+ working-directory: ./erofs-utils/
+ run: |
+ make
+ make install
+
+ - name: tar erofs-utils binaries
+ run: tar -cvf erofs-utils-binaries.tar -C ${{ github.workspace }}/erofs-utils-install/bin .
+
+ - name: upload erofs-utils binaries
+ uses: actions/upload-artifact@v4
+ with:
+ name: erofs-utils-binaries
+ path: erofs-utils-binaries.tar
+ overwrite: true
+
+ mkfs-correctness:
+ needs: build
+ strategy:
+ fail-fast: false
+ matrix:
+ algorithm: ['', '-zlz4', '-zlz4hc', '-zdeflate']
+ dedupe: ['', '-Ededupe']
+ fragments: ['', '-Efragments', '-Eall-fragments']
+ ztailpacking: ['', '-Eztailpacking']
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: cache Linux-src
+ id: cache-linux-src
+ uses: actions/cache@v4
+ with:
+ path: 'Linux-src'
+ key: Linux-src-v6.7
+
+ - name: checkout Linux-src if not cached
+ if: steps.cache-linux-src.outputs.cache-hit != 'true'
+ uses: actions/checkout@v4
+ with:
+ repository: 'torvalds/linux'
+ ref: 'v6.7'
+ path: 'Linux-src'
+
+ - name: download erofs-utils binaries
+ uses: actions/download-artifact@v4
+ with:
+ name: erofs-utils-binaries
+
+ - name: untar erofs-utils binaries
+ run:
+ tar -xvf erofs-utils-binaries.tar
+
+ - name: test mkfs.erofs
+ run: |
+ ./mkfs.erofs --quiet ${{ matrix.algorithm }} ${{ matrix.dedupe }} ${{ matrix.fragments }} ${{ matrix.ztailpacking }} erofs-test.img Linux-src/
+ ./fsck.erofs --extract=extract-dir/ erofs-test.img
+
+ HASH1=$(find extract-dir -type f -exec sha256sum {} + | sed 's/extract-dir//g' | sort -k2 | sha256sum -)
+ HASH2=$(find Linux-src -type f -exec sha256sum {} + | sed 's/Linux-src//g' | sort -k2 | sha256sum -)
+ if [ "$HASH1" = "$HASH2" ]; then
+ echo "PASS!"
+ fi
\ No newline at end of file
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] erofs-utils: introduce GitHub Actions CI
2024-01-20 15:25 [PATCH] erofs-utils: introduce GitHub Actions CI Yifan Zhao
@ 2024-01-21 3:33 ` Gao Xiang
0 siblings, 0 replies; 2+ messages in thread
From: Gao Xiang @ 2024-01-21 3:33 UTC (permalink / raw)
To: Yifan Zhao; +Cc: linux-erofs
Hi Yifan,
On Sat, Jan 20, 2024 at 11:25:57PM +0800, Yifan Zhao wrote:
> This commit introduces a new CI workflow configuration designed to
> automate the testing process for erofs-utils. This CI is based on the
> free GitHub Actions for we have a fork in GitHub. The CI will be
> triggered on every push to the {main,dev,experimental} branch.
>
> Currently, we have only a simple test for ensuring the correctness of
> mkfs.erofs, which covers a small subset of its extended options
> including dedupe, fragments, ztailpacking and {lz4,lz4hc,deflate}
> compression algorithms. It creates a EROFS image using Linux v6.7 source
> code as the workload, then extracts it using fsck.erofs and compares the
> sha256sum of the extracted files with the original ones.
Personally, I tend to avoid relying on any Github infrastructure for
the erofs-utils codebase. Previously it already checked enwik8
correctness in the Github CI, see:
https://github.com/erofs/erofsnightly/blob/main/.github/workflows/smoking.yml#L185
If you would like to add a Github CI for Linux codebase, please
update
https://github.com/erofs/erofsnightly/actions
nightly CI instead.
Thanks,
Gao Xiang
>
> Signed-off-by: Yifan Zhao <zhaoyifan@sjtu.edu.cn>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-21 3:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-20 15:25 [PATCH] erofs-utils: introduce GitHub Actions CI Yifan Zhao
2024-01-21 3:33 ` Gao Xiang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.