diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 8255dd210821..ab0555dcddf1 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -1,51 +1,56 @@ ## The testings are done this way ```mermaid flowchart TB subgraph CleanUp and Summary - Part1-20.04-->CleanUp+nice+Summary - Part2-20.04-->CleanUp+nice+Summary - PartN-20.04-->CleanUp+nice+Summary - Part1-22.04-->CleanUp+nice+Summary - Part2-22.04-->CleanUp+nice+Summary - PartN-22.04-->CleanUp+nice+Summary + sanity-checks-20.04-->CleanUp+Summary + Part1-20.04-->CleanUp+Summary + Part2-20.04-->CleanUp+Summary + Part3-20.04-->CleanUp+Summary + Part4-20.04-->CleanUp+Summary + Part1-22.04-->CleanUp+Summary + Part2-22.04-->CleanUp+Summary + Part3-22.04-->CleanUp+Summary + Part4-22.04-->CleanUp+Summary + sanity-checks-22.04-->CleanUp+Summary end subgraph Functional Testings + sanity-checks-20.04 + zloop-checks-20.04 functional-testing-20.04-->Part1-20.04 functional-testing-20.04-->Part2-20.04 - functional-testing-20.04-->PartN-20.04 + functional-testing-20.04-->Part3-20.04 + functional-testing-20.04-->Part4-20.04 functional-testing-22.04-->Part1-22.04 functional-testing-22.04-->Part2-22.04 - functional-testing-22.04-->PartN-22.04 -end - -subgraph Sanity and zloop Testings - sanity-checks-20.04-->functional-testing-20.04 - sanity-checks-22.04-->functional-testing-22.04 - zloop-checks-20.04-->functional - zloop-checks-22.04-->functional + functional-testing-22.04-->Part3-22.04 + functional-testing-22.04-->Part4-22.04 + sanity-checks-22.04 + zloop-checks-22.04 end subgraph Code Checking + Building + Build-Ubuntu-20.04-->sanity-checks-20.04 + Build-Ubuntu-20.04-->zloop-checks-20.04 + Build-Ubuntu-20.04-->functional-testing-20.04 codeql.yml checkstyle.yml - Build-Ubuntu-20.04-->sanity-checks-20.04 Build-Ubuntu-22.04-->sanity-checks-22.04 - Build-Ubuntu-20.04-->zloop-checks-20.04 Build-Ubuntu-22.04-->zloop-checks-22.04 + Build-Ubuntu-22.04-->functional-testing-22.04 end ``` 1) build zfs modules for Ubuntu 20.04 and 22.04 (~15m) 2) 2x zloop test (~10m) + 2x sanity test (~25m) -3) functional testings in parts 1..5 (each ~1h) +3) 4x functional testings in parts 1..4 (each ~1h) 4) cleanup and create summary - content of summary depends on the results of the steps When everything runs fine, the full run should be done in about 2 hours. The codeql.yml and checkstyle.yml are not part in this circle. diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index b0fdc570d473..abcb358fc04f 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -1,59 +1,59 @@ name: checkstyle on: push: pull_request: jobs: checkstyle: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Install dependencies run: | # https://github.com/orgs/community/discussions/47863 sudo apt-mark hold grub-efi-amd64-signed sudo apt-get update --fix-missing sudo apt-get upgrade sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/checkstyle-dependencies.txt apt-get install -qq sudo python3 -m pip install --quiet flake8 sudo apt-get clean # confirm that the tools are installed # the build system doesn't fail when they are not checkbashisms --version cppcheck --version flake8 --version scanelf --version shellcheck --version - name: Prepare run: | ./autogen.sh ./configure make -j$(nproc) --no-print-directory --silent - name: Checkstyle run: | make -j$(nproc) --no-print-directory --silent checkstyle - name: Lint run: | make -j$(nproc) --no-print-directory --silent lint - name: CheckABI id: CheckABI run: | docker run -v $PWD:/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent checkabi - name: StoreABI if: failure() && steps.CheckABI.outcome == 'failure' run: | docker run -v $PWD:/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent storeabi - name: Prepare artifacts if: failure() && steps.CheckABI.outcome == 'failure' run: | find -name *.abi | tar -cf abi_files.tar -T - - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() && steps.CheckABI.outcome == 'failure' with: name: New ABI files (use only if you're sure about interface changes) path: abi_files.tar diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7ccfc1492564..e015b2cb71d9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,41 +1,41 @@ name: "CodeQL" on: push: pull_request: jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'cpp', 'python' ] steps: - name: Set make jobs run: | echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: config-file: .github/codeql-${{ matrix.language }}.yml languages: ${{ matrix.language }} - name: Autobuild uses: github/codeql-action/autobuild@v2 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/scripts/generate-summary.sh b/.github/workflows/scripts/generate-summary.sh index cd5ea3421c94..b5d89208a5d8 100755 --- a/.github/workflows/scripts/generate-summary.sh +++ b/.github/workflows/scripts/generate-summary.sh @@ -1,119 +1,119 @@ #!/usr/bin/env bash # for runtime reasons we split functional testings into N parts # - use a define to check for missing tarfiles FUNCTIONAL_PARTS="4" ZTS_REPORT="tests/test-runner/bin/zts-report.py" chmod +x $ZTS_REPORT function output() { echo -e $* >> Summary.md } function error() { output ":bangbang: $* :bangbang:\n" } # this function generates the real summary # - expects a logfile "log" in current directory function generate() { # we issued some error already test ! -s log && return # for overview and zts-report cat log | grep '^Test' > list # error details awk '/\[FAIL\]|\[KILLED\]/{ show=1; print; next; } /\[SKIP\]|\[PASS\]/{ show=0; } show' log > err # summary of errors if [ -s err ]; then output "
"
     $ZTS_REPORT --no-maybes ./list >> Summary.md
     output "
" # generate seperate error logfile ERRLOGS=$((ERRLOGS+1)) errfile="err-$ERRLOGS.md" echo -e "\n## $headline (debugging)\n" >> $errfile echo "
Error Listing - with dmesg and dbgmsg
" >> $errfile
     dd if=err bs=999k count=1 >> $errfile
     echo "
" >> $errfile else output "All tests passed :thumbsup:" fi output "
Full Listing
"
   cat list >> Summary.md
   output "
" # remove tmp files rm -f err list log } # check tarfiles and untar function check_tarfile() { if [ -f "$1" ]; then tar xf "$1" || error "Tarfile $1 returns some error" else error "Tarfile $1 not found" fi } # check logfile and concatenate test results function check_logfile() { if [ -f "$1" ]; then cat "$1" >> log else error "Logfile $1 not found" fi } # sanity function summarize_s() { headline="$1" output "\n## $headline\n" rm -rf testfiles check_tarfile "$2/sanity.tar" check_logfile "testfiles/log" generate } # functional function summarize_f() { headline="$1" output "\n## $headline\n" rm -rf testfiles for i in $(seq 1 $FUNCTIONAL_PARTS); do - tarfile="$2/part$i.tar" + tarfile="$2-part$i/part$i.tar" check_tarfile "$tarfile" check_logfile "testfiles/log" done generate } # https://docs.github.com/en/enterprise-server@3.6/actions/using-workflows/workflow-commands-for-github-actions#step-isolation-and-limits # Job summaries are isolated between steps and each step is restricted to a maximum size of 1MiB. # [ ] can not show all error findings here # [x] split files into smaller ones and create additional steps ERRLOGS=0 if [ ! -f Summary/Summary.md ]; then # first call, we do the default summary (~500k) echo -n > Summary.md summarize_s "Sanity Tests Ubuntu 20.04" Logs-20.04-sanity summarize_s "Sanity Tests Ubuntu 22.04" Logs-22.04-sanity summarize_f "Functional Tests Ubuntu 20.04" Logs-20.04-functional summarize_f "Functional Tests Ubuntu 22.04" Logs-22.04-functional cat Summary.md >> $GITHUB_STEP_SUMMARY mkdir -p Summary mv *.md Summary else # here we get, when errors where returned in first call test -f Summary/err-$1.md && cat Summary/err-$1.md >> $GITHUB_STEP_SUMMARY fi exit 0 diff --git a/.github/workflows/zfs-linux-tests.yml b/.github/workflows/zfs-linux-tests.yml index c4fe930d092c..753f3cd0214e 100644 --- a/.github/workflows/zfs-linux-tests.yml +++ b/.github/workflows/zfs-linux-tests.yml @@ -1,124 +1,124 @@ name: zfs-linux-tests on: workflow_call: inputs: os: description: 'The ubuntu version: 20.02 or 22.04' required: true type: string jobs: zloop: runs-on: ubuntu-${{ inputs.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: modules-${{ inputs.os }} - name: Install modules run: | tar xzf modules-${{ inputs.os }}.tgz .github/workflows/scripts/setup-dependencies.sh tests - name: Tests timeout-minutes: 30 run: | sudo mkdir -p /var/tmp/zloop # run for 10 minutes or at most 2 iterations for a maximum runner # time of 20 minutes. sudo /usr/share/zfs/zloop.sh -t 600 -I 2 -l -m1 -- -T 120 -P 60 - name: Prepare artifacts if: failure() run: | sudo chmod +r -R /var/tmp/zloop/ - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: Zpool-logs-${{ inputs.os }} path: | /var/tmp/zloop/*/ !/var/tmp/zloop/*/vdev/ retention-days: 14 if-no-files-found: ignore - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: Zpool-files-${{ inputs.os }} path: | /var/tmp/zloop/*/vdev/ retention-days: 14 if-no-files-found: ignore sanity: runs-on: ubuntu-${{ inputs.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: modules-${{ inputs.os }} - name: Install modules run: | tar xzf modules-${{ inputs.os }}.tgz .github/workflows/scripts/setup-dependencies.sh tests - name: Tests timeout-minutes: 60 shell: bash run: | set -o pipefail /usr/share/zfs/zfs-tests.sh -vKR -s 3G -r sanity | scripts/zfs-tests-color.sh - name: Prepare artifacts if: success() || failure() run: | RESPATH="/var/tmp/test_results" mv -f $RESPATH/current $RESPATH/testfiles tar cf $RESPATH/sanity.tar -h -C $RESPATH testfiles - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: success() || failure() with: name: Logs-${{ inputs.os }}-sanity path: /var/tmp/test_results/sanity.tar if-no-files-found: ignore functional: runs-on: ubuntu-${{ inputs.os }} strategy: fail-fast: false matrix: tests: [ part1, part2, part3, part4 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: modules-${{ inputs.os }} - name: Install modules run: | tar xzf modules-${{ inputs.os }}.tgz .github/workflows/scripts/setup-dependencies.sh tests - name: Setup tests run: | .github/workflows/scripts/setup-functional.sh ${{ matrix.tests }} >> $GITHUB_ENV - name: Tests timeout-minutes: 120 shell: bash run: | set -o pipefail /usr/share/zfs/zfs-tests.sh -vKR -s 3G -T ${{ env.TODO }} | scripts/zfs-tests-color.sh - name: Prepare artifacts if: success() || failure() run: | RESPATH="/var/tmp/test_results" mv -f $RESPATH/current $RESPATH/testfiles tar cf $RESPATH/${{ matrix.tests }}.tar -h -C $RESPATH testfiles - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: success() || failure() with: - name: Logs-${{ inputs.os }}-functional + name: Logs-${{ inputs.os }}-functional-${{ matrix.tests }} path: /var/tmp/test_results/${{ matrix.tests }}.tar if-no-files-found: ignore diff --git a/.github/workflows/zfs-linux.yml b/.github/workflows/zfs-linux.yml index be3908deb948..e6b705c86055 100644 --- a/.github/workflows/zfs-linux.yml +++ b/.github/workflows/zfs-linux.yml @@ -1,64 +1,64 @@ name: zfs-linux on: push: pull_request: jobs: build: name: Build strategy: fail-fast: false matrix: os: [20.04, 22.04] runs-on: ubuntu-${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Build modules run: .github/workflows/scripts/setup-dependencies.sh build - name: Prepare modules upload run: tar czf modules-${{ matrix.os }}.tgz *.deb .github tests/test-runner tests/ImageOS.txt - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: modules-${{ matrix.os }} path: modules-${{ matrix.os }}.tgz retention-days: 14 testings: name: Testing strategy: fail-fast: false matrix: os: [20.04, 22.04] needs: build uses: ./.github/workflows/zfs-linux-tests.yml with: os: ${{ matrix.os }} cleanup: if: always() name: Cleanup runs-on: ubuntu-22.04 needs: testings steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 - name: Generating summary run: | tar xzf modules-22.04/modules-22.04.tgz .github tests .github/workflows/scripts/generate-summary.sh # up to 4 steps, each can have 1 MiB output (for debugging log files) - name: Summary for errors #1 run: .github/workflows/scripts/generate-summary.sh 1 - name: Summary for errors #2 run: .github/workflows/scripts/generate-summary.sh 2 - name: Summary for errors #3 run: .github/workflows/scripts/generate-summary.sh 3 - name: Summary for errors #4 run: .github/workflows/scripts/generate-summary.sh 4 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Summary Files path: Summary/