DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org, aconole@redhat.com
Cc: Michael Santana <maicolgabriel@hotmail.com>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: [dpdk-dev] [PATCH] ci: fix default ccache in GitHub Actions
Date: Tue,  5 Jan 2021 13:16:25 +0100	[thread overview]
Message-ID: <20210105121625.8863-1-david.marchand@redhat.com> (raw)

'main' might not be the default branch name.

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0b72df0ebe..751eb82c16 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -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.23.0


             reply	other threads:[~2021-01-05 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 12:16 David Marchand [this message]
2021-01-05 14:09 ` Aaron Conole
2021-01-19 12:17   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210105121625.8863-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=aconole@redhat.com \
    --cc=dev@dpdk.org \
    --cc=maicolgabriel@hotmail.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).