Skip to content

Commit

Permalink
Add edge rad CLI pull to samples tests (#737)
Browse files Browse the repository at this point in the history
* Add install-radius script

Signed-off-by: willdavsmith <[email protected]>

* chmod

Signed-off-by: willdavsmith <[email protected]>

* test

Signed-off-by: willdavsmith <[email protected]>

* test

Signed-off-by: willdavsmith <[email protected]>

* test

Signed-off-by: willdavsmith <[email protected]>

* test

Signed-off-by: willdavsmith <[email protected]>

* test

Signed-off-by: willdavsmith <[email protected]>

* test

Signed-off-by: willdavsmith <[email protected]>

* test

Signed-off-by: willdavsmith <[email protected]>

* PR

Signed-off-by: willdavsmith <[email protected]>

* PR

Signed-off-by: willdavsmith <[email protected]>

* PR

Signed-off-by: willdavsmith <[email protected]>

* PR

Signed-off-by: willdavsmith <[email protected]>

* PR

Signed-off-by: willdavsmith <[email protected]>

* PR

Signed-off-by: willdavsmith <[email protected]>

---------

Signed-off-by: willdavsmith <[email protected]>
  • Loading branch information
willdavsmith authored Nov 6, 2023
1 parent 4e2561b commit bd8ce98
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 18 deletions.
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

0 comments on commit bd8ce98

Please sign in to comment.