1name: zfs-linux
2
3on:
4  push:
5  pull_request:
6
7jobs:
8
9  build:
10    name: Build
11    strategy:
12      fail-fast: false
13      matrix:
14        os: [20.04, 22.04]
15    runs-on: ubuntu-${{ matrix.os }}
16    steps:
17    - uses: actions/checkout@v4
18      with:
19        ref: ${{ github.event.pull_request.head.sha }}
20    - name: Build modules
21      run: .github/workflows/scripts/setup-dependencies.sh build
22    - name: Prepare modules upload
23      run: tar czf modules-${{ matrix.os }}.tgz *.deb .github tests/test-runner tests/ImageOS.txt
24    - uses: actions/upload-artifact@v4
25      with:
26        name: modules-${{ matrix.os }}
27        path: modules-${{ matrix.os }}.tgz
28        retention-days: 14
29
30  testings:
31    name: Testing
32    strategy:
33      fail-fast: false
34      matrix:
35        os: [20.04, 22.04]
36    needs: build
37    uses: ./.github/workflows/zfs-linux-tests.yml
38    with:
39      os: ${{ matrix.os }}
40
41  cleanup:
42    if: always()
43    name: Cleanup
44    runs-on: ubuntu-22.04
45    needs: testings
46    steps:
47    - uses: actions/download-artifact@v4
48    - name: Generating summary
49      run: |
50        tar xzf modules-22.04/modules-22.04.tgz .github tests
51        .github/workflows/scripts/generate-summary.sh
52    # up to 4 steps, each can have 1 MiB output (for debugging log files)
53    - name: Summary for errors #1
54      run: .github/workflows/scripts/generate-summary.sh 1
55    - name: Summary for errors #2
56      run: .github/workflows/scripts/generate-summary.sh 2
57    - name: Summary for errors #3
58      run: .github/workflows/scripts/generate-summary.sh 3
59    - name: Summary for errors #4
60      run: .github/workflows/scripts/generate-summary.sh 4
61    - uses: actions/upload-artifact@v4
62      with:
63        name: Summary Files
64        path: Summary/
65