From 47f41ac257b32a4b60961bffa4eceaf2e36fd3e6 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Wed, 25 May 2022 15:20:33 +0200 Subject: [PATCH 1/5] Speed up diff generation --- .github/workflows/diff_tests.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/diff_tests.yml b/.github/workflows/diff_tests.yml index d4bada95..7f8821b3 100644 --- a/.github/workflows/diff_tests.yml +++ b/.github/workflows/diff_tests.yml @@ -30,18 +30,12 @@ jobs: - name: Adding github workspace as safe directory # See issue https://github.com/actions/checkout/issues/760 run: git config --global --add safe.directory $GITHUB_WORKSPACE - - name: Fetch merge - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: true - name: Fetch base branch uses: actions/checkout@v3 with: ref: ${{ github.base_ref }} - fetch-depth: 0 submodules: true - path: old + fetch-depth: 0 - name: Install utility tools shell: bash run: | @@ -58,17 +52,26 @@ jobs: -L -o vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm-${{ matrix.llvm }}_amd64.tar.xz tar xf vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm-${{ matrix.llvm }}_amd64.tar.xz - - name: Build old rellic + - name: Configure rellic shell: bash run: | - cmake -S old -B rellic-build-old -DVCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm-${{ matrix.llvm }}_amd64 - cmake --build rellic-build-old + cmake -S $GITHUB_WORKSPACE \ + -B rellic-build \ + -DVCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm-${{ matrix.llvm }}_amd64 - - name: Build new rellic + - name: Build old rellic shell: bash run: | - cmake -S . -B rellic-build -DVCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm-${{ matrix.llvm }}_amd64 cmake --build rellic-build + cp rellic-build/tools/rellic-decomp rellic-build/tools/rellic-decomp-old + + - name: Checkout merge branch + shell: bash + run: git checkout --progress --force ${{ github.ref }} + + - name: Build new rellic + shell: bash + run: cmake --build rellic-build - name: Print job summary shell: bash @@ -76,7 +79,7 @@ jobs: echo "# Test diffs" >> $GITHUB_STEP_SUMMARY cd $GITHUB_WORKSPACE/tests/tools/decomp env CLANG=clang-14 \ - OLD_RELLIC=$GITHUB_WORKSPACE/rellic-build-old/tools/rellic-decomp \ + OLD_RELLIC=$GITHUB_WORKSPACE/rellic-build/tools/rellic-decomp-old \ NEW_RELLIC=$GITHUB_WORKSPACE/rellic-build/tools/rellic-decomp \ make -s -j1 -f diff_outputs.mk >> $GITHUB_STEP_SUMMARY @@ -86,7 +89,7 @@ jobs: run: | cd $GITHUB_WORKSPACE/tests/tools/decomp env CLANG=clang-14 \ - OLD_RELLIC=$GITHUB_WORKSPACE/rellic-build-old/tools/rellic-decomp \ + OLD_RELLIC=$GITHUB_WORKSPACE/rellic-build/tools/rellic-decomp-old \ NEW_RELLIC=$GITHUB_WORKSPACE/rellic-build/tools/rellic-decomp \ make -s -j1 -f diff_outputs.mk >> $GITHUB_WORKSPACE/test-diff.md From 69e52ac701b172c9573dca822441fa39a6514b9a Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Thu, 14 Jul 2022 10:19:31 +0200 Subject: [PATCH 2/5] Use suggestion --- .github/workflows/diff_tests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/diff_tests.yml b/.github/workflows/diff_tests.yml index 7f8821b3..e66cd978 100644 --- a/.github/workflows/diff_tests.yml +++ b/.github/workflows/diff_tests.yml @@ -30,12 +30,11 @@ jobs: - name: Adding github workspace as safe directory # See issue https://github.com/actions/checkout/issues/760 run: git config --global --add safe.directory $GITHUB_WORKSPACE - - name: Fetch base branch + - name: Checkout base branch uses: actions/checkout@v3 with: - ref: ${{ github.base_ref }} + ref: ${{ github.event.pull_request.base.ref }} submodules: true - fetch-depth: 0 - name: Install utility tools shell: bash run: | @@ -66,8 +65,10 @@ jobs: cp rellic-build/tools/rellic-decomp rellic-build/tools/rellic-decomp-old - name: Checkout merge branch - shell: bash - run: git checkout --progress --force ${{ github.ref }} + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + submodules: true - name: Build new rellic shell: bash From 945145e1743456987dbcbf746e61cb80da4f687b Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Sun, 17 Jul 2022 10:39:17 +0200 Subject: [PATCH 3/5] Do simple checkout --- .github/workflows/diff_tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/diff_tests.yml b/.github/workflows/diff_tests.yml index e66cd978..09433933 100644 --- a/.github/workflows/diff_tests.yml +++ b/.github/workflows/diff_tests.yml @@ -65,10 +65,8 @@ jobs: cp rellic-build/tools/rellic-decomp rellic-build/tools/rellic-decomp-old - name: Checkout merge branch - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - submodules: true + shell: bash + run: git checkout ${{ github.event.pull_request.head.ref }} - name: Build new rellic shell: bash From 693305c79324a39fc1e4da7fdaa5a2c7be393894 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Mon, 18 Jul 2022 10:18:24 +0200 Subject: [PATCH 4/5] Use commit SHA instead of ref --- .github/workflows/diff_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/diff_tests.yml b/.github/workflows/diff_tests.yml index 09433933..9352c861 100644 --- a/.github/workflows/diff_tests.yml +++ b/.github/workflows/diff_tests.yml @@ -66,7 +66,7 @@ jobs: - name: Checkout merge branch shell: bash - run: git checkout ${{ github.event.pull_request.head.ref }} + run: git checkout ${{ github.event.pull_request.head.sha }} - name: Build new rellic shell: bash From 031610865fcc2679619ff1dccf48fc79f3892c32 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Mon, 18 Jul 2022 14:48:37 +0200 Subject: [PATCH 5/5] Fetch before checkout --- .github/workflows/diff_tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/diff_tests.yml b/.github/workflows/diff_tests.yml index 9352c861..ac6e5ac1 100644 --- a/.github/workflows/diff_tests.yml +++ b/.github/workflows/diff_tests.yml @@ -66,7 +66,9 @@ jobs: - name: Checkout merge branch shell: bash - run: git checkout ${{ github.event.pull_request.head.sha }} + run: | + git fetch + git checkout ${{ github.event.pull_request.head.sha }} - name: Build new rellic shell: bash