working on plan #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build cat-once | |
run: | | |
cargo build --release | |
sudo mv target/release/cat-once /usr/bin/cat-once | |
- name: Prepare test file | |
run: | | |
cat-once --file test.file --test-create-ascii-file-size=1000000000 | |
sha1sum test.file > test-in.file.sha1 | |
tar -cf - test.file | zstd -c > test.tar.zstd | |
- name: Mount tmpfs | |
run: | | |
mkdir tmp | |
sudo mount -t tmpfs -o size=1560M tmpfs tmp | |
cp test.tar.zstd tmp | |
cd tmp | |
cat-once --file test.tar.zstd --safety-time 1 > test2.tar.zstd | |
cat-once --file test2.tar.zstd --safety-time 1 | tar -I zstd -xf - -C . | |
sha1sum test.file > ../test-out.file.sha1 | |
- name: Compare checksums | |
run: | | |
cat test-in.file.sha1 | |
cat test-out.file.sha1 | |
diff test-in.file.sha1 test-out.file.sha1 |