Skip to content

Merge pull request #1266 from swirlai/ds-1784-main #716

Merge pull request #1266 from swirlai/ds-1784-main

Merge pull request #1266 from swirlai/ds-1784-main #716

Workflow file for this run

name: Unit Tests
on:
push:
# Only trigger on branches, not on tags
branches:
- 'main'
- 'develop'
paths-ignore:
- '.github/**'
- 'docs/**'
- 'README.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the Code
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.2'
cache: 'pip' # caching pip stuff
- name: Install Swirl
run: ./install.sh
- name: Install pytest Unit Tests
run: ./install-test.sh
- name: Run pytest Unit Tests
run: pytest
- name: Create Artifacts Directory
run: mkdir -p artifacts
- name: Set Branch Name
id: extract_branch
run: |
BRANCH_NAME=$(echo $GITHUB_REF | cut -d "/" -f 3)
echo "branch=$BRANCH_NAME" >> $GITHUB_ENV
- name: Write Branch and run_id to File
run: |
echo "${{ env.branch }}" > ./artifacts/branch.txt
echo "${{ github.run_id }}" > ./artifacts/run_id.txt
- name: Upload Branch and run_id Files as Artifacts
uses: actions/upload-artifact@v4
with:
name: branch-info-${{ github.run_id }}
path: |
./artifacts/branch.txt
./artifacts/run_id.txt
- name: Upload Log Files
if: always()
uses: actions/upload-artifact@v4
with:
name: log-files
path: |
logs/
/var/log/syslog*