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 workflow for tagged release #167

Merged
merged 4 commits into from
Jan 31, 2024
Merged
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
30 changes: 30 additions & 0 deletions .github/workflows/build-test-release-tagged.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: build-test-release-tagged

on:
push:
tags:
- v*

jobs:
build-test-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build all targets.
run: |
make build-all
- name: Run unit tests across all targets.
run: |
make test-all
- name: Prepare scenarios to be released.
run: |
sudo apt install zip
zip -r scenarios.zip scenarios
- name: Release Innovation Engine
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
files: |
./bin/ie
./scenarios.zip
16 changes: 16 additions & 0 deletions .github/workflows/scenario-testing.yaml
Original file line number Diff line number Diff line change
@@ -13,6 +13,22 @@ permissions:
id-token: write
contents: read
jobs:
test-ie-installation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check ie installation
run: |
cat scripts/install_from_release.sh | /bin/bash
if ! command -v ie; then
echo "ie not found"
exit 1
fi
if [ ! -d "${HOME}/scenarios" ]
then
echo "scenarios not found"
exit 1
fi
test-ocd-scenarios:
runs-on: ubuntu-latest
# This is needed in order to obtain OIDC tokens to sign this pipeline into
17 changes: 11 additions & 6 deletions scripts/install_from_release.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
# Script to install scenarios file. Pass in language code parameter for a particular language, such as it-it for Italian.
set -e

# Define the language parameter
# TODO: make parameters mandatory
LANG="$1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a step to our primary testing pipeline which makes sure that the installation script always works and does a few things? The two things I have in mind for the test are to check if:

  1. Installs IE on to the PATH
  2. Can access the scenarios folder

SCENARIOS=""
RELEASE="$2"

# If no release is specified, download the latest release
if [ "$RELEASE" == "" ]; then
RELEASE="latest"
fi

# Map the language parameter to the corresponding scenarios file
# If no parameter, download the scenarios from IE
if [ "$LANG" = "" ]; then
SCENARIOS='https://github.com/Azure/InnovationEngine/releases/download/latest/scenarios.zip'
SCENARIOS="https://github.com/Azure/InnovationEngine/releases/download/$RELEASE/scenarios.zip"
# Otherwise, download the scenarios from Microsoft Docs in the appropriate langauge
elif [ "$LANG" = "en-us" ]; then
SCENARIOS='https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/scenarios.zip'
else
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$LANG-scenarios.zip"
fi

# Download the binary from the latest
echo "Installing IE & scenarios from the latest release..."
wget -q -O ie https://github.com/Azure/InnovationEngine/releases/download/latest/ie > /dev/null
# Download the binary
echo "Installing IE & scenarios from the $RELEASE release..."
wget -q -O ie https://github.com/Azure/InnovationEngine/releases/download/$RELEASE/ie > /dev/null
wget -q -O scenarios.zip "$SCENARIOS" > /dev/null

# Setup permissions & move to the local bin