From 6d2d58d4934f1404b6c84886ccaf81945fca6b1a Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Mon, 2 Oct 2023 09:46:26 -0400 Subject: [PATCH] wip --- .github/workflows/build.yaml | 165 ++++++++++++++++++++++++++++++++++- 1 file changed, 164 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1b88271b89..7e8368129f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -125,7 +125,7 @@ jobs: path: build/leap_*.deb tests: - name: Tests ${{matrix.cfg.name}} + name: Tests (${{matrix.cfg.name}}) needs: [platform-cache, build-base] strategy: fail-fast: false @@ -155,3 +155,166 @@ jobs: - name: Check CPU Features run: awk 'BEGIN {err = 1} /bmi2/ && /adx/ {err = 0} END {exit err}' /proc/cpuinfo + np-tests: + name: NP Tests (${{matrix.cfg.name}}) + needs: [platform-cache, build-base] + strategy: + fail-fast: false + matrix: + include: + - cfg: {name: 'ubuntu20', base: 'ubuntu20', builddir: 'ubuntu20'} + - cfg: {name: 'ubuntu22', base: 'ubuntu22', builddir: 'ubuntu22'} + - cfg: {name: 'ubuntu20repro', base: 'ubuntu20', builddir: 'reproducible'} + - cfg: {name: 'ubuntu22repro', base: 'ubuntu22', builddir: 'reproducible'} + runs-on: ["self-hosted", "enf-x86-midtier"] + steps: + - uses: actions/checkout@v3 + - name: Download builddir + uses: actions/download-artifact@v3 + with: + name: ${{matrix.cfg.builddir}}-build + - name: Run tests in parallel containers + uses: ./.github/actions/parallel-ctest-containers + with: + container: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.cfg.base].image}} + error-log-paths: '["build/etc", "build/var", "build/leap-ignition-wd", "build/TestLogs"]' + log-tarball-prefix: ${{matrix.cfg.name}} + tests-label: nonparallelizable_tests + test-timeout: 420 + - name: Upload logs from failed tests + uses: actions/upload-artifact@v3 + if: failure() + with: + name: ${{matrix.cfg.name}}-np-logs + path: '*-logs.tar.gz' + + lr-tests: + name: LR Tests (${{matrix.cfg.name}}) + needs: [platform-cache, build-base] + strategy: + fail-fast: false + matrix: + include: + - cfg: {name: 'ubuntu20', base: 'ubuntu20', builddir: 'ubuntu20'} + - cfg: {name: 'ubuntu22', base: 'ubuntu22', builddir: 'ubuntu22'} + - cfg: {name: 'ubuntu20repro', base: 'ubuntu20', builddir: 'reproducible'} + - cfg: {name: 'ubuntu22repro', base: 'ubuntu22', builddir: 'reproducible'} + runs-on: ["self-hosted", "enf-x86-lowtier"] + steps: + - uses: actions/checkout@v3 + - name: Download builddir + uses: actions/download-artifact@v3 + with: + name: ${{matrix.cfg.builddir}}-build + - name: Run tests in parallel containers + uses: ./.github/actions/parallel-ctest-containers + with: + container: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.cfg.base].image}} + error-log-paths: '["build/etc", "build/var", "build/leap-ignition-wd", "build/TestLogs"]' + log-tarball-prefix: ${{matrix.cfg.name}} + tests-label: long_running_tests + test-timeout: 1800 + - name: Upload logs from failed tests + uses: actions/upload-artifact@v3 + if: failure() + with: + name: ${{matrix.cfg.name}}-lr-logs + path: '*-logs.tar.gz' + + libtester-tests: + name: libtester tests + needs: [platform-cache, build-base, v, dev-package] + strategy: + fail-fast: false + matrix: + platform: [ubuntu20, ubuntu22] + test: [build-tree, make-dev-install, deb-install] + runs-on: ["self-hosted", "enf-x86-midtier"] + container: ${{ matrix.test != 'deb-install' && fromJSON(needs.platform-cache.outputs.platforms)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }} + env: + DEBIAN_FRONTEND: noninteractive + TZ: Etc/UTC + steps: + - name: Update Package Index & Upgrade Packages + run: | + apt-get update + apt-get upgrade -y + + # LEAP + - if: ${{ matrix.test != 'deb-install' }} + name: Clone leap + uses: actions/checkout@v3 + with: + submodules: recursive + - if: ${{ matrix.test != 'deb-install' }} + name: Download leap builddir + uses: actions/download-artifact@v3 + with: + name: ${{matrix.platform}}-build + - if: ${{ matrix.test != 'deb-install' }} + name: Extract leap build + run: | + zstdcat build.tar.zst | tar x + - if: ${{ matrix.test == 'build-tree' }} + name: Set leap_DIR env var + run: | + echo "leap_DIR=$PWD/build/lib/cmake/leap" >> "$GITHUB_ENV" + - if: ${{ matrix.test == 'make-dev-install' }} + name: leap dev-install + run: | + cmake --install build + cmake --install build --component dev + - if: ${{ matrix.test == 'make-dev-install' }} + name: Delete leap artifacts + run: | + rm -r * + - if: ${{ matrix.test == 'deb-install' }} + name: Download leap-dev + uses: actions/download-artifact@v3 + with: + name: leap-dev-${{matrix.platform}}-amd64 + - if: ${{ matrix.test == 'deb-install' }} + name: Install leap-dev Package + run: | + apt-get install -y ./*.deb + rm ./*.deb + + # CDT + - name: Download cdt + uses: AntelopeIO/asset-artifact-download-action@v3 + with: + owner: AntelopeIO + repo: cdt + file: 'cdt_.*amd64.deb' + target: '${{needs.v.outputs.cdt-target}}' + prereleases: ${{fromJSON(needs.v.outputs.cdt-prerelease)}} + artifact-name: cdt_ubuntu_package_amd64 + - name: Install cdt Packages + run: | + apt-get install -y ./*.deb + rm ./*.deb + + # Reference Contracts + - name: checkout eos-system-contracts + uses: actions/checkout@v3 + with: + repository: eosnetworkfoundation/eos-system-contracts + path: eos-system-contracts + ref: '${{needs.v.outputs.eos-system-contracts-ref}}' + - if: ${{ matrix.test == 'deb-install' }} + name: Install eos-system-contracts deps + run: | + apt-get -y install cmake build-essential + - name: Build & Test eos-system-contracts + run: | + cmake -S eos-system-contracts -B eos-system-contracts/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DSYSTEM_ENABLE_LEAP_VERSION_CHECK=Off -DSYSTEM_ENABLE_CDT_VERSION_CHECK=Off + cmake --build eos-system-contracts/build -- -j $(nproc) + cd eos-system-contracts/build/tests + ctest --output-on-failure -j $(nproc) + + all-passing: + name: All Required Tests Passed + needs: [dev-package, tests, np-tests, libtester-tests] + runs-on: ubuntu-latest + steps: + - run: true \ No newline at end of file