|
| 1 | + |
| 2 | +name: Run GNU Test |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - 'main' |
| 9 | + |
| 10 | +jobs: |
| 11 | + native: |
| 12 | + name: Run GNU tests (native) |
| 13 | + runs-on: ubuntu-24.04 |
| 14 | + steps: |
| 15 | + - name: Checkout code (uutils/util-linux) |
| 16 | + uses: actions/checkout@v6 |
| 17 | + with: |
| 18 | + path: uutils-util-linux |
| 19 | + - name: Checkout code (util-linux/util-linux) |
| 20 | + uses: actions/checkout@v6 |
| 21 | + with: |
| 22 | + repository: util-linux/util-linux |
| 23 | + path: gnu-util-linux |
| 24 | + ref: v2.41.4 |
| 25 | + - uses: Swatinem/rust-cache@v2 |
| 26 | + with: |
| 27 | + workspaces: "./uutils-util-linux -> target" |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + sudo apt-get update --quiet |
| 31 | + # omit preinstalled tools <https://github.com/actions/runner-images/tree/main/images/ubuntu> |
| 32 | + sudo apt-get install -y \ |
| 33 | + autopoint gettext bc socat ntp squashfs-tools \ |
| 34 | + libcap-ng-dev libpam-dev libudev-dev python3-dev libmount-dev libclang-dev libsmartcols-dev |
| 35 | + - name: Build GNU tests |
| 36 | + run: | |
| 37 | + cd gnu-util-linux |
| 38 | + ./autogen.sh |
| 39 | + ./configure |
| 40 | + make libsmartcols/src/filter-parser.c libsmartcols/src/filter-scanner.c |
| 41 | + make -j$(nproc) check-programs |
| 42 | + - name: Download test baseline if exists |
| 43 | + id: download-test-baseline |
| 44 | + continue-on-error: true |
| 45 | + uses: actions/download-artifact@v8 |
| 46 | + with: |
| 47 | + name: gnu-test-failures |
| 48 | + path: uutils-util-linux/.reference/ |
| 49 | + |
| 50 | + - name: Run GNU tests |
| 51 | + env: |
| 52 | + GNU_PROJECT_DIR: ${{ github.workspace }}/gnu-util-linux |
| 53 | + run: | |
| 54 | + cd uutils-util-linux |
| 55 | + ./scripts/run-tests.sh |
| 56 | +
|
| 57 | + - name: Update test baseline |
| 58 | + if: github.ref == 'refs/heads/main' |
| 59 | + run: | |
| 60 | + cd uutils-util-linux |
| 61 | + ./scripts/check-new-gnu-failures.sh --update-baseline |
| 62 | +
|
| 63 | + - name: Upload test baseline artifact |
| 64 | + if: github.ref == 'refs/heads/main' || steps.download-test-baseline.outcome == 'failure' |
| 65 | + uses: actions/upload-artifact@v7 |
| 66 | + with: |
| 67 | + name: gnu-test-failures |
| 68 | + path: uutils-util-linux/.reference/gnu-test-failures.txt |
0 commit comments