Merge pull request #59 from sonic-howl/develop #133
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
# This file describes the Continuous Integration (CI) steps. It will run a series of tests on every GitLab Pull Request (PR) | |
name: CI | |
on: | |
pull_request: | |
branches: [main, develop] | |
push: | |
branches: [main, develop] | |
jobs: | |
lint_and_format_checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install ruff | |
- name: Lint | |
run: ruff check --output-format=github . | |
# Temporarily disabled. The files in the test directory were causing formatting issues. | |
# - name: Check Formatting | |
# run: ruff format --check | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install robotpy | |
run: | | |
python -m pip install --upgrade pip | |
python3 -m pip install robotpy | |
- name: Sync robotpy | |
working-directory: ./src | |
run: | | |
python3 -m robotpy sync | |
- name: Install dependencies | |
run: | | |
python3 -m pip install ruff | |
python3 -m pip install coverage | |
python3 -m pip install opencv-python | |
- name: Run tests | |
working-directory: ./src | |
run: | | |
python3 -m unittest | |
# BUG: Action to preview HTML files currenctly not working: https://github.com/pavi2410/html-preview-action | |
# - name: Generate coverage report | |
# run: | | |
# python3 -m robotpy coverage test | |
# coverage html -d coverage_html | |
# - name: HTML Preview | |
# id: html_preview | |
# uses: pavi2410/html-preview-action@v2 | |
# with: | |
# html_file: "coverage_html/index.html" | |
# - name: test | |
# run: | | |
# echo ${{ steps.html_preview.outputs.url }} |