Skip to content

Cleanup package

Cleanup package #10

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Run Tests
on:
push:
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
test-main:
if: ${{ github.repository == 'slaclab/lcls-tools' }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.MEME_KEY }}'
python -m pip install --upgrade pip
pip install flake8
pip install ".[meme-ssh]"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 .
- name: Test with unittest
run: |
echo -e '## Test results\n\n```' >> "$GITHUB_STEP_SUMMARY"
python -m unittest discover -s tests -v 2>&1 | tee -a "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
test-general:
if: ${{ github.repository != 'slaclab/lcls-tools' }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 .
- name: Test with unittest
run: |
echo -e '## Test results\n\n```' >> "$GITHUB_STEP_SUMMARY"
python -m unittest discover -s tests -v 2>&1 | tee -a "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"