update ci jobs

This commit is contained in:
thatmattlove 2024-03-01 23:20:02 -05:00
parent 99ec07d055
commit fc58f57d10
4 changed files with 84 additions and 106 deletions

View file

@ -1,61 +1,60 @@
name: Backend Testing
on:
- push
- pull_request
- push
- pull_request
jobs:
backend:
name: Backend Tests
strategy:
fail-fast: false
matrix:
node-version: [18.x]
redis-version: [6]
poetry-version: [1.2.2]
python-version: [3.9]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
backend:
name: Backend Tests
strategy:
fail-fast: false
matrix:
node-version: [20.x]
redis-version: [7]
python-version: [3.9, 3.10, 3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Git Checkout
uses: actions/checkout@v3
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2.2.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Setup Rye
uses: sksat/setup-rye@v0.8.0
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.1.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Prepare
run: |
mkdir -p "$HOME/hyperglass"
echo "HYPERGLASS_APP_PATH=$HOME/hyperglass" >> $GITHUB_ENV
echo "HYPERGLASS_HOST=127.0.0.1" >> $GITHUB_ENV
echo "HYPERGLASS_PORT=8001" >> $GITHUB_ENV
- name: Prepare
run: |
mkdir -p "$HOME/hyperglass"
echo "HYPERGLASS_APP_PATH=$HOME/hyperglass" >> $GITHUB_ENV
echo "HYPERGLASS_HOST=127.0.0.1" >> $GITHUB_ENV
echo "HYPERGLASS_PORT=8001" >> $GITHUB_ENV
- name: Install (Poetry)
run: poetry install
- name: Enter venv
run: . .venv/bin/activate
- name: Lint (Flake8)
run: poetry run task lint
- name: Install
run: rye install
# This needs to come before testing, so redis is pre-populated.
- name: Run hyperglass
run: '.tests/ga-backend-app.sh'
- name: Lint (Rye)
run: rye lint
- name: Test (PyTest)
run: poetry run task test
- name: Tests (PyTest)
run: task test
- name: Run hyperglass
run: ".tests/ga-backend-app.sh"

View file

@ -1,44 +1,44 @@
name: Frontend Testing
on:
- push
- pull_request
- push
- pull_request
jobs:
frontend:
name: Frontend Tests
strategy:
fail-fast: false
matrix:
node-version: [18.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
working-directory: ./hyperglass/ui
steps:
- name: Git Checkout
uses: actions/checkout@v3
frontend:
name: Frontend Tests
strategy:
fail-fast: false
matrix:
node-version: [20.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
working-directory: ./hyperglass/ui
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
working-directory: ${{ env.working-directory }}
run: yarn install
- name: Install Dependencies
working-directory: ${{ env.working-directory }}
run: pnpm install
- name: Formatting (Prettier)
working-directory: ${{ env.working-directory }}
run: yarn format:check
- name: Formatting
working-directory: ${{ env.working-directory }}
run: pnpm run format:check
- name: Lint (ESLint)
working-directory: ${{ env.working-directory }}
run: yarn lint
- name: Lint
working-directory: ${{ env.working-directory }}
run: pnpm run lint
- name: Types (TypeScript)
working-directory: ${{ env.working-directory }}
run: yarn typecheck
- name: Check Types
working-directory: ${{ env.working-directory }}
run: pnpm run typecheck
- name: Tests (Jest)
working-directory: ${{ env.working-directory }}
run: yarn test
- name: Tests
working-directory: ${{ env.working-directory }}
run: pnpm run test

View file

@ -1,20 +0,0 @@
name: Installer Testing
on:
- push
- pull_request
jobs:
installer:
name: Installer Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Run hyperglass
run: 'sudo bash ./install.sh'

View file

@ -3,11 +3,10 @@
LOG_FILE="$HOME/hyperglass-ci.log"
touch /tmp/hyperglass.log
export POETRY_HYPERGLASS_UI_BUILD_TIMEOUT="600"
echo "[INFO] Set build timeout to $POETRY_HYPERGLASS_UI_BUILD_TIMEOUT seconds"
. .venv/bin/activate
echo "[INFO] Starting setup..."
poetry run hyperglass setup -d &>$LOG_FILE
python3 -m hyperglass.console setup -d &>$LOG_FILE
echo "[SUCCESS] Setup completed."
sleep 2
@ -18,7 +17,7 @@ echo "[INFO] Copying devices.yaml file..."
cp ./.tests/devices.yaml $HOME/hyperglass/devices.yaml
echo "[INFO] Starting UI build."
poetry run hyperglass build-ui &>$LOG_FILE
python3 -m hyperglass.console build-ui &>$LOG_FILE
if [[ ! $? == 0 ]]; then
echo "[ERROR] Failed to build hyperglass ui."
@ -30,7 +29,7 @@ else
fi
echo "[INFO] Starting hyperglass..."
poetry run hyperglass start &>$LOG_FILE &
python3 -m hyperglass.console start &>$LOG_FILE &
sleep 120
if [[ ! $? == 0 ]]; then