Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 26 additions & 79 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: CI Workflow
name: CI Build/Test

on:
push:
branches:
- '**'
- develop
- feature/develop/task3
pull_request:
branches:
- develop
Expand All @@ -15,110 +13,59 @@ jobs:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Python environment
- name: Set up Python 3.x
uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'

# Install PyInstaller
- name: Install PyInstaller
run: |
python -m pip install --upgrade pip
pip install pyinstaller
# Install Python dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r TicTacToeSWPart/requirements.txt
pip install pytest

# Install Arduino CLI
- name: Set up Arduino CLI
# Set up Arduino CLI
- name: Set up Arduino
run: |
wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz
tar -xvf arduino-cli_latest_Linux_64bit.tar.gz
sudo mv arduino-cli /usr/local/bin/
arduino-cli config init

# Install Arduino AVR core and libraries
- name: Install Arduino AVR core and libraries
- name: Add Arduino AVR Boards package
run: |
arduino-cli core update-index
arduino-cli core install arduino:avr
arduino-cli lib install ArduinoJson

# Compile Arduino Sketch (simulated)
- name: Compile Arduino Sketch (simulated)
run: |
mkdir -p build # Ensure the build directory exists
arduino-cli compile --fqbn arduino:avr:nano:cpu=atmega328old --output-dir build INOTicTacToe/INOTicTacToe.ino

# Generate client executable from Python script
- name: Generate executable
run: |
mkdir -p dist # Ensure the dist directory exists
pyinstaller --onefile GUI.py

# Upload the generated executable as an artifact
- name: Upload executable as artifact
uses: actions/upload-artifact@v3
with:
name: compiled-executable
path: dist/GUI # This is the generated file from PyInstaller

# Download the artifact (the executable)
- name: Download compiled executable artifact
uses: actions/download-artifact@v3
with:
name: compiled-executable

# Install pyserial
- name: Install pyserial
# Install and configure Doxygen
- name: Install Doxygen
run: |
pip install pyserial

# Run PowerShell Script to execute tests
- name: Run PowerShell script to execute tests
sudo apt-get update
sudo apt-get install -y doxygen

# Generate Doxygen Documentation
- name: Generate Doxygen Documentation
run: |
pwsh ./RunAllTests.ps1

# Upload the test log as an artifact
- name: Upload test results log
doxygen -g # Generates a default Doxyfile if none exists
sed -i 's|OUTPUT_DIRECTORY.*|OUTPUT_DIRECTORY = ./docs|' Doxyfile
sed -i 's|INPUT.*|INPUT = ./|' Doxyfile
sed -i 's|RECURSIVE.*|RECURSIVE = YES|' Doxyfile
doxygen Doxyfile

# Upload documentation as artifact
- name: Upload documentation as artifact
uses: actions/upload-artifact@v3
with:
name: test-results-log
path: test_results.log

- name: Add AVR package URL
run: |
arduino-cli config set board_manager.additional_urls https://downloads.arduino.cc/packages/package_index.json

- name: Install AVR core
run: |
arduino-cli core update-index
arduino-cli core install arduino:avr # Install AVR core for Arduino boards

- name: Compile Arduino Sketch for uno
run: |
mkdir -p build # Ensure the build directory exists
arduino-cli compile --fqbn arduino:avr:uno --output-dir build HWPart/TicTacToe/TicTacToe.ino
name: docs_html
path: docs/html

# Collect binaries as artifacts
- name: Upload binaries
- name: Upload binaries reports
uses: actions/upload-artifact@v3
with:
name: compiled-files
path: build/*.hex
path: build/*.hex

# Collect test results as artifacts
- name: Upload test reports
uses: actions/upload-artifact@v3
with:
name: test-reports
path: test-reports/results.xml

Loading