From 852eabce955379ebb562e3f98bb331229ab007cc Mon Sep 17 00:00:00 2001 From: Stephen Chen <20940639+stephenctw@users.noreply.github.com> Date: Mon, 21 Aug 2023 21:29:48 +0800 Subject: [PATCH] feat(ci): enable log tests only on main branch with tags pushed --- .github/workflows/test-logs.yml | 40 +++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 18 ++++----------- 2 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test-logs.yml diff --git a/.github/workflows/test-logs.yml b/.github/workflows/test-logs.yml new file mode 100644 index 0000000..70dd713 --- /dev/null +++ b/.github/workflows/test-logs.yml @@ -0,0 +1,40 @@ +name: Test logs and proofs +on: + push: + branches: + - main + tags: + - '*' +env: + UARCH_LOG_TEST_VERSION: v0.15.1 +jobs: + test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + token: ${{ secrets.CI_TOKEN }} + - uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: gpp + version: 2.27 + + - name: Download uarch test log files + uses: Legion2/download-release-action@v2.1.0 + with: + repository: ${{ github.repository_owner }}/machine-emulator + tag: ${{ env.UARCH_LOG_TEST_VERSION }} + file: uarch-riscv-tests-json-logs-${{ env.UARCH_LOG_TEST_VERSION }}.tar.gz + token: ${{ secrets.CI_TOKEN }} + + - name: Untar uarch test logs + run: mkdir -p test/uarch-log && tar -xzf uarch-riscv-tests-json-logs-${UARCH_LOG_TEST_VERSION}.tar.gz -C test/uarch-log + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Run replay tests + run: make test-replay diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a658797..e1de870 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,6 @@ name: Test on: [push] env: UARCH_BIN_TEST_VERSION: v0.29.0 - UARCH_LOG_TEST_VERSION: v0.15.1 jobs: test: runs-on: ubuntu-22.04 @@ -24,24 +23,15 @@ jobs: file: machine-tests-${{ env.UARCH_BIN_TEST_VERSION }}.tar.gz token: ${{ secrets.CI_TOKEN }} - - name: Download uarch test log files - uses: Legion2/download-release-action@v2.1.0 - with: - repository: ${{ github.repository_owner }}/machine-emulator - tag: ${{ env.UARCH_LOG_TEST_VERSION }} - file: uarch-riscv-tests-json-logs-${{ env.UARCH_LOG_TEST_VERSION }}.tar.gz - token: ${{ secrets.CI_TOKEN }} - - name: Untar uarch test bins run: mkdir -p test/uarch-bin && tar -xzf machine-tests-${UARCH_BIN_TEST_VERSION}.tar.gz -C test/uarch-bin && rm test/uarch-bin/*.dump - - name: Untar uarch test logs - run: mkdir -p test/uarch-log && tar -xzf uarch-riscv-tests-json-logs-${UARCH_LOG_TEST_VERSION}.tar.gz -C test/uarch-log - - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: version: nightly - - name: Run all tests - run: make test-all + - name: Run mock and production tests + run: | + make test-mock + make test-prod