f3probe: employ libflow #66
Workflow file for this run
This file contains hidden or 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: Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: {} | |
| jobs: | |
| Linux: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| volume: | |
| - /tmp | |
| - . | |
| - relative-path | |
| - / | |
| asroot: | |
| - name: '' | |
| sudo: '' | |
| - name: ' as root' | |
| sudo: 'sudo ' | |
| name: Linux ${{ matrix.volume }}${{ matrix.asroot.name }} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - run: sudo apt-get install -y libparted-dev libudev-dev | |
| - run: make all extra | |
| - if: matrix.volume == 'relative-path' | |
| run: mkdir relative-path | |
| - if: matrix.volume == '/' | |
| run: sudo chmod a+w / | |
| - run: ./f3write -V | |
| - run: ./f3write --help | |
| - run: ${{ matrix.asroot.sudo }}./f3write -s 2 -e 4 -w 50000 ${{ matrix.volume }} | |
| - run: stat ${{ matrix.volume }}/2.h2w | |
| - run: stat ${{ matrix.volume }}/3.h2w | |
| - run: stat ${{ matrix.volume }}/4.h2w | |
| - run: ./f3read -V | |
| - run: ./f3read --help | |
| - run: ${{ matrix.asroot.sudo }}./f3read -s 2 -e 4 -r 50000 ${{ matrix.volume }} | |
| - run: ./f3probe -V | |
| - run: ./f3probe --help | |
| - run: ./f3brew -V | |
| - run: ./f3brew --help | |
| - run: ./f3fix -V | |
| - run: ./f3fix --help | |
| - name: Create loop device for f3probe, f3brew, and f3fix tests | |
| id: loop | |
| run: | | |
| dd if=/dev/zero of=dummy.img bs=1M count=10 | |
| sudo losetup -fP dummy.img | |
| echo "dev=$(sudo losetup -j dummy.img | cut -d: -f1)" >> $GITHUB_OUTPUT | |
| - run: sudo ./f3probe ${{ steps.loop.outputs.dev }} | |
| - run: sudo ./f3brew --reset-type=2 -h 0 -e 4 ${{ steps.loop.outputs.dev }} | |
| - run: sudo ./f3fix --first-sec 1 --last-sec 10 ${{ steps.loop.outputs.dev }} | |
| - name: Cleanup loop device | |
| if: always() | |
| run: | | |
| if [ -n "${{ steps.loop.outputs.dev }}" ]; then | |
| sudo losetup -d ${{ steps.loop.outputs.dev }} | |
| fi | |
| rm -f dummy.img | |
| MacOS: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| volume: | |
| - /tmp | |
| - . | |
| - relative-path | |
| # MacOS denies `sudo chmod a+w /` | |
| #- / | |
| asroot: | |
| - name: '' | |
| sudo: '' | |
| - name: ' as root' | |
| sudo: 'sudo ' | |
| name: MacOS ${{ matrix.volume }}${{ matrix.asroot.name }} | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - run: brew install argp-standalone | |
| - run: make | |
| - if: matrix.volume == 'relative-path' | |
| run: mkdir relative-path | |
| - run: ./f3write -V | |
| - run: ./f3write --help | |
| - run: ${{ matrix.asroot.sudo }}./f3write -s 2 -e 4 -w 50000 ${{ matrix.volume }} | |
| - run: stat ${{ matrix.volume }}/2.h2w | |
| - run: stat ${{ matrix.volume }}/3.h2w | |
| - run: stat ${{ matrix.volume }}/4.h2w | |
| - run: ./f3read -V | |
| - run: ./f3read --help | |
| - run: ${{ matrix.asroot.sudo }}./f3read -s 2 -e 4 -r 50000 ${{ matrix.volume }} | |
| Cygwin: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| volume: | |
| - cygwin: /cygdrive/c | |
| windows: 'C:' | |
| - cygwin: . | |
| windows: . | |
| - cygwin: relative-path | |
| windows: relative-path | |
| - cygwin: / | |
| windows: 'C:\cygwin' | |
| name: Cygwin ${{ matrix.volume.cygwin }} | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: cygwin/cygwin-install-action@v2 | |
| with: | |
| packages: gcc-core libargp-devel make | |
| - run: "$Env:LDFLAGS = '-Wl,--stack,4000000'; make" | |
| - if: matrix.volume.windows == 'relative-path' | |
| run: New-Item -ItemType Directory -Path relative-path | |
| - run: '& .\f3write.exe -V' | |
| - run: '& .\f3write.exe --help' | |
| - run: '& .\f3write.exe -s 2 -e 4 -w 50000 ${{ matrix.volume.cygwin }}' | |
| - run: 'Get-Item ${{ matrix.volume.windows }}\2.h2w' | |
| - run: 'Get-Item ${{ matrix.volume.windows }}\3.h2w' | |
| - run: 'Get-Item ${{ matrix.volume.windows }}\4.h2w' | |
| - run: '& .\f3read.exe -V' | |
| - run: '& .\f3read.exe --help' | |
| - run: '& .\f3read.exe -s 2 -e 4 -r 50000 ${{ matrix.volume.cygwin }}' |