From 710692b8e798d5550b5e071cc7d23d3a36e8238f Mon Sep 17 00:00:00 2001 From: "Galantsev, Dmitrii" Date: Wed, 22 Jan 2025 13:54:41 -0600 Subject: [PATCH] Update workflow to artifacts@v4 Change-Id: Ib08a0afc0954ea2eb581425cbf9cf1d7715cebc5 Signed-off-by: Galantsev, Dmitrii [ROCm/rdc commit: 9dd58b6907ed7199b14b04702a9d5db4539814a0] --- projects/rdc/.github/workflows/main.yml | 16 ++++++++++------ projects/rdc/run_github_actions_locally.sh | 13 ++++++++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/projects/rdc/.github/workflows/main.yml b/projects/rdc/.github/workflows/main.yml index f54fc8dd19..83471d043a 100644 --- a/projects/rdc/.github/workflows/main.yml +++ b/projects/rdc/.github/workflows/main.yml @@ -22,7 +22,7 @@ env: jobs: build: runs-on: lstt - container: rocm/rocm-build-ubuntu-22.04:6.2 + container: rocm/rocm-build-ubuntu-22.04:6.3 outputs: BUILD_NUM: ${{ steps.build_number.outputs.BUILD_NUM }} TODAY: ${{ steps.build_number.outputs.TODAY }} @@ -36,7 +36,9 @@ jobs: cat /etc/os-release apt update -y # provides add-apt-repository and support for caching actions - apt install -y software-properties-common jq nodejs + apt install -y software-properties-common jq curl + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt install -y nodejs add-apt-repository -y ppa:apt-fast/stable apt update -y apt install -y apt-fast @@ -131,7 +133,7 @@ jobs: # important to use v3 because v4 doesn't work with act: # https://github.com/nektos/act/issues/329 - name: Package RDC - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: rdc path: build/rdc*.deb @@ -141,7 +143,7 @@ jobs: test: needs: build runs-on: lstt - container: rocm/rocm-build-ubuntu-22.04:6.2 + container: rocm/rocm-build-ubuntu-22.04:6.3 steps: - name: Set up apt repos @@ -149,10 +151,12 @@ jobs: cat /etc/os-release apt update -y # provides add-apt-repository and support for caching actions - apt install -y software-properties-common jq nodejs + apt install -y software-properties-common jq curl + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt install -y nodejs - name: Package RDC - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: rdc path: /opt/ diff --git a/projects/rdc/run_github_actions_locally.sh b/projects/rdc/run_github_actions_locally.sh index ec5a927d90..016b55082d 100755 --- a/projects/rdc/run_github_actions_locally.sh +++ b/projects/rdc/run_github_actions_locally.sh @@ -6,7 +6,18 @@ set -eu set -o pipefail -REMOTE_NAME="${REMOTE_NAME:-origin}" +get_remote() { + # redirect all stderr to /dev/null + exec 3>&2 + exec 2>/dev/null + + git config --get branch."$(git rev-parse --abbrev-ref HEAD)".remote || echo origin + + # restore stderr + exec 2>&3 +} + +REMOTE_NAME="${REMOTE_NAME:-$(get_remote)}" CONTAINER="${CONTAINER:-ubuntu}" # act will use this file if it exists for vars