Skip to contentSkip to conversation

ci: fix default ccache in GitHub Actions

PATCH In review David Marchand 2 participants 3 messages Jan 5, 2021 – Jan 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ci: fix default ccache in GitHub Actions

'main' might not be the default branch name.

Fixes 87009585e293 ("ci: hook to GitHub Actions")

---
I found no other option but to call to the remote repository since github does not seem to expose a HEAD symbolic reference.

The other alternative would be to simply rename ovsrobot/dpdk default branch from 'master' to 'main'.
Example: https://github.com/ovsrobot/dpdk/runs/1641274373?check_suite_focus=true#step:4:4

---
 .github/workflows/build.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
.github/workflows/build.yml +3 -1
index 0b72df0ebe..751eb82c16 100644
@@ -67,13 +67,15 @@ jobs:
         echo 'libabigail-${{ matrix.config.os }}'
         echo -n '::set-output name=abi::'
         echo 'abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.LIBABIGAIL_VERSION }}-${{ env.REF_GIT_TAG }}'
+        echo -n '::set-output name=default_branch::'
+        git ls-remote --symref origin HEAD |awk '/^ref:/ {print $2}'
     - name: Retrieve ccache cache
       uses: actions/cache@v2
       with:
         path: ~/.ccache
         key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
         restore-keys: |
-          ${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
+          ${{ steps.get_ref_keys.outputs.ccache }}-${{ steps.get_ref_keys.outputs.default_branch }}
     - name: Retrieve libabigail cache
       id: libabigail-cache
       uses: actions/cache@v2
Signature · 1 line
2.23.0
#1 lore raw
Quoted 8 lines · David Marchand

'main' might not be the default branch name.

Fixes 87009585e293 ("ci: hook to GitHub Actions")

---
I found no other option but to call to the remote repository since github does not seem to expose a HEAD symbolic reference.

Ugh... I thought I had set it to 'main' during DPDKs transition, but seems I didn't (guess it was just an oversight on my part - sorry).

Quoted 2 lines

The other alternative would be to simply rename ovsrobot/dpdk default branch from 'master' to 'main'.

I will do that rename anyway - it should be consistent.

Quoted 27 lines

Example: https://github.com/ovsrobot/dpdk/runs/1641274373?check_suite_focus=true#step:4:4

---
 .github/workflows/build.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
.github/workflows/build.yml +3 -1
index 0b72df0ebe..751eb82c16 100644
@@ -67,13 +67,15 @@ jobs:
         echo 'libabigail-${{ matrix.config.os }}'
         echo -n '::set-output name=abi::'
         echo 'abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.LIBABIGAIL_VERSION }}-${{ env.REF_GIT_TAG }}'
+        echo -n '::set-output name=default_branch::'
+        git ls-remote --symref origin HEAD |awk '/^ref:/ {print $2}'
     - name: Retrieve ccache cache
       uses: actions/cache@v2
       with:
         path: ~/.ccache
         key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
         restore-keys: |
-          ${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
+          ${{ steps.get_ref_keys.outputs.ccache }}-${{ steps.get_ref_keys.outputs.default_branch }}
     - name: Retrieve libabigail cache
       id: libabigail-cache
       uses: actions/cache@v2
#2 lore raw
Quoted 12 lines · Aaron Conole
Quoted 8 lines · David Marchand

'main' might not be the default branch name.

Fixes 87009585e293 ("ci: hook to GitHub Actions")

---
I found no other option but to call to the remote repository since github does not seem to expose a HEAD symbolic reference.

Quoted 7 lines

Ugh... I thought I had set it to 'main' during DPDKs transition, but seems I didn't (guess it was just an oversight on my part - sorry).

Quoted 2 lines

The other alternative would be to simply rename ovsrobot/dpdk default branch from 'master' to 'main'.

I will do that rename anyway - it should be consistent.

I dropped the patch, thanks for fixing on the robot side.

Signature · 1 line
David marchand