Update demo_test_fixtures.yml #23
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: CI for Surveilr Tests | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout www.surveilr.com repository | |
uses: actions/checkout@v3 | |
with: | |
repository: surveilr/www.surveilr.com | |
token: ${{ secrets.GH_PAT }} | |
ref: 'main' | |
# Step 1: Set up jq | |
- name: Install jq | |
run: sudo apt-get install -y jq | |
# Step 1: Set up Deno | |
- name: Set up Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.46.3 | |
# Step 2: Check Deno Version | |
- name: Check Deno Version | |
run: | | |
echo "Checking Deno version..." | |
deno --version | |
- name: Install or Upgrade Surveilr | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
run: | | |
set -e | |
cd ./lib/assurance/ # Change to the assurance directory | |
echo "Checking for Surveilr installation..." | |
if command -v surveilr &>/dev/null; then | |
echo "Surveilr is installed. Upgrading..." | |
./surveilr upgrade | |
else | |
echo "Surveilr not found. Installing..." | |
echo "Fetching latest release..." | |
latest_release=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/opsfolio/releases.opsfolio.com/releases/latest) | |
echo "Latest release response: $latest_release" | |
download_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | contains("tar.gz")) | .browser_download_url') | |
if [ -z "$download_url" ]; then | |
echo "No downloadable asset found for Surveilr." | |
exit 1 | |
fi | |
echo "Downloading Surveilr from $download_url..." | |
curl -L -o surveilr.tar.gz "$download_url" | |
tar -xzf surveilr.tar.gz | |
chmod +x surveilr | |
fi | |
# Step 5: Check Versions | |
- name: Check Versions | |
run: | | |
echo "Checking versions..." | |
cd ./lib/assurance/ # Ensure we're in the right directory | |
./surveilr --version # Check surveilr version | |
# Step 6: Run Deno Tests | |
- name: Run Deno Tests | |
run: | | |
echo "Running Deno tests..." | |
cd ./lib/assurance/ # Ensure we're in the right directory | |
deno test -A --fail-fast |