From 0892684d0521d285f6b85f610cd8bbf730ff1e41 Mon Sep 17 00:00:00 2001 From: yomaytk Date: Thu, 12 Mar 2026 18:36:43 +0000 Subject: [PATCH] Refactored .github/workflows/tests.yml --- .github/workflows/tests.yml | 85 ++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 594ea453..d1d890ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,54 +17,49 @@ permissions: contents: read jobs: - build-and-test-aarch64: - runs-on: ubuntu-22.04-arm - name: AArch64 Build-and-Run + build-and-test: + name: ${{ matrix.arch }} Build-and-Run + strategy: + fail-fast: false + matrix: + include: + - arch: AArch64 + runner: ubuntu-22.04-arm + build-arg: ECV_AARCH64=1 + - arch: AMD64 + runner: ubuntu-22.04 + build-arg: ECV_X86=1 + runs-on: ${{ matrix.runner }} steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: build container image - run: docker build . --build-arg ECV_AARCH64=1 -t elfconv-image + run: docker build . --build-arg ${{ matrix.build-arg }} -t elfconv-image - name: run integration test - run: docker run --rm -w /root/elfconv/build elfconv-image "ninja test_dependencies && ctest" - - build-and-test-amd64: - runs-on: ubuntu-22.04 - name: AMD64 Build-and-Run - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: build container image - run: docker build . --build-arg ECV_X86=1 -t elfconv-image - - - name: run instruction tests run: docker run --rm -w /root/elfconv/build elfconv-image "ninja test_dependencies && ctest --output-on-failure" - browser-test-aarch64: - runs-on: ubuntu-22.04-arm - name: Browser Integration Test (hello_world) - steps: - - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - - name: build container image - run: docker build . --build-arg ECV_AARCH64=1 -t elfconv-image - - - name: run browser test - run: | - docker run --rm -w /root/elfconv elfconv-image \ - "cd tests/browser && \ - npm install && \ - npx playwright install --with-deps chromium && \ - bash build.sh hello && \ - npx playwright test --project=hello" - - browser-test-bash-aarch64: + browser-test: runs-on: ubuntu-22.04-arm - name: Browser Integration Test (bash) + name: Browser Integration Test (${{ matrix.project }}) + strategy: + fail-fast: false + matrix: + include: + - project: hello + setup: "true" + - project: bash + setup: >- + apt-get update && apt-get install -qqy --no-install-recommends bash-static && + BUSYBOX_VERSION=1.36.1 && + wget -q https://busybox.net/downloads/busybox-\${BUSYBOX_VERSION}.tar.bz2 && + tar xjf busybox-\${BUSYBOX_VERSION}.tar.bz2 && + cp examples/examples-repos/.config busybox-\${BUSYBOX_VERSION}/.config && + make -C busybox-\${BUSYBOX_VERSION} -j\$(nproc) && + mkdir -p examples/examples-repos/busybox && + cp busybox-\${BUSYBOX_VERSION}/busybox examples/examples-repos/busybox/busybox && + rm -rf busybox-\${BUSYBOX_VERSION} busybox-\${BUSYBOX_VERSION}.tar.bz2 steps: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 @@ -75,17 +70,9 @@ jobs: - name: run browser test run: | docker run --rm -w /root/elfconv elfconv-image \ - "apt-get update && apt-get install -qqy --no-install-recommends bash-static && \ - BUSYBOX_VERSION=1.36.1 && \ - wget -q https://busybox.net/downloads/busybox-\${BUSYBOX_VERSION}.tar.bz2 && \ - tar xjf busybox-\${BUSYBOX_VERSION}.tar.bz2 && \ - cp examples/examples-repos/.config busybox-\${BUSYBOX_VERSION}/.config && \ - make -C busybox-\${BUSYBOX_VERSION} -j\$(nproc) && \ - mkdir -p examples/examples-repos/busybox && \ - cp busybox-\${BUSYBOX_VERSION}/busybox examples/examples-repos/busybox/busybox && \ - rm -rf busybox-\${BUSYBOX_VERSION} busybox-\${BUSYBOX_VERSION}.tar.bz2 && \ + "${{ matrix.setup }} && \ cd tests/browser && \ npm install && \ npx playwright install --with-deps chromium && \ - bash build.sh bash && \ - npx playwright test --project=bash" + bash build.sh ${{ matrix.project }} && \ + npx playwright test --project=${{ matrix.project }}"