[MTM-59397] As a plugin developer I want to have a workflow that will collect shell versions and run cypress tests against them #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Collect shell versions | |
on: | |
pull_request: # TODO: change workflow trigger | |
permissions: | |
contents: read | |
env: | |
ACTIONS_STEP_DEBUG: true | |
jobs: | |
collect-shell-versions: | |
timeout-minutes: 30 | |
runs-on: ubuntu-22.04 | |
name: Get shell versions by tags | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
# - name: Install dependencies | |
# run: npm ci | |
# | |
# - name: Build | |
# run: npm run build:ci | |
# | |
# - name: Upload build artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: build | |
# if-no-files-found: error | |
# retention-days: 5 | |
# path: | | |
# dist/apps/sag-pkg-community-plugins/** | |
- name: Get @c8y/ngx-components, non-deprecated dist versions | |
id: check-deprecated | |
run: npm run collect-shell-versions | |
- name: Use non-deprecated versions | |
run: | | |
echo "Non-deprecated Versions: ${{ steps.check-deprecated.outputs.non_deprecated_shell_versions }}" | |
# further should run in loop for each shell version | |
- name: Get shell app of particular version | |
run: | | |
# Extract the 'next' tag version from the JSON | |
json=${{ steps.check-deprecated.outputs.non_deprecated_shell_versions }} | |
next_version=$(echo $json | jq -r '.next') | |
echo "Version is: $next_version" | |
# Construct the file URL | |
file_url="http://resources.cumulocity.com/webapps/ui-releases/apps-${next_version}.tgz" | |
echo "File url is: $file_url " | |
# # Download the file | |
# curl -O $file_url | |
# # Extract the downloaded tar.gz file | |
# tar -xzf "apps-${next_version}.tgz" | |
# | |
# # Locate and extract the cockpit file inside the extracted folder | |
# extracted_folder=$(basename "apps-${next_version}" .tgz) | |
# cockpit_file="cockpit-${next_version}.tgz" | |
# find "$extracted_folder" -name "$cockpit_file" -exec tar -xzf {} -C "dist/apps" \; | |
# | |
# # Echo the elements of dist/apps | |
# echo "Contents of dist/apps:" | |
# ls dist/apps | |
# | |
# - name: Check dist folder | |
# run: | | |
# # Echo the elements of dist/apps | |
# echo "Contents of dist/apps:" | |
# ls dist/apps | |
# ls dist/apps/cockpit-1020.0.10 | |
# ls dist/apps/sag-pkg-community-plugins |