Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add edge rad CLI pull to samples tests #737

Merged
merged 15 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/scripts/install-radius.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ------------------------------------------------------------
# Copyright 2023 The Radius Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------

set -xe

VERSION=$1
RAD_CLI_URL=https://raw.githubusercontent.com/radius-project/radius/main/deploy/install.sh
RAD_CLI_EDGE_URL=ghcr.io/radius-project/rad/linux-amd64:latest

if [[ $VERSION == "edge" ]]; then
echo Downloading rad CLI edge version
oras pull $RAD_CLI_EDGE_URL
chmod +x ./rad
mv ./rad /usr/local/bin/rad
elif [[ -n $VERSION && $VERSION != *"rc"* ]]; then
INPUT_CHANNEL=$(echo $VERSION | cut -d '.' -f 1,2)
echo "Downloading rad CLI version $INPUT_CHANNEL"
wget -q $RAD_CLI_URL -O - | /bin/bash -s $INPUT_CHANNEL
elif [[ -n $VERSION ]]; then
echo Downloading rad CLI version $VERSION
wget -q $RAD_CLI_URL -O - | /bin/bash -s $VERSION
else
echo Downloading latest rad CLI
wget -q $RAD_CLI_URL -O - | /bin/bash
fi
23 changes: 5 additions & 18 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ on:
schedule: # 7:45 AM Pacific Time
- cron: "45 15 * * *"
env:
RAD_CLI_URL: https://raw.githubusercontent.com/radius-project/radius/main/deploy/install.sh
RUN_IDENTIFIER: samplestest-${{ github.run_id }}-${{ github.run_attempt }}
jobs:
test:
Expand Down Expand Up @@ -182,23 +181,11 @@ jobs:
- name: Download rad CLI
if: steps.gen-id.outputs.RUN_TEST == 'true'
run: |
for attempt in 1 2 3 4 5; do
if [[ -n "${{ inputs.version }}" && "${{ inputs.version }}" != "edge" && "${{ inputs.version }}" != *"rc"* ]]; then
INPUT_CHANNEL=$(echo "${{ inputs.version }}" | cut -d '.' -f 1,2)
echo "Downloading rad CLI version $INPUT_CHANNEL"
wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash -s $INPUT_CHANNEL
elif [[ -n "${{ inputs.version }}" ]]; then
echo "Downloading rad CLI version ${{ inputs.version }}"
wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash -s ${{ inputs.version }}
else
echo "Downloading latest rad CLI"
wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash
fi

if [ $? -eq 0 ]; then
break
fi
done
RADIUS_VERSION="${{ inputs.version }}"
if [[ -z "${{ inputs.version }}" ]]; then
RADIUS_VERSION=edge
fi
./.github/scripts/install-radius.sh $RADIUS_VERSION
- name: Initialize local environment
if: steps.gen-id.outputs.RUN_TEST == 'true'
run: |
Expand Down
Loading