Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/use docker #266

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
27 changes: 0 additions & 27 deletions .github/workflows/build-firmware.yml

This file was deleted.

156 changes: 156 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: CI Pipeline

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
run-c-static-analysis:
name: Run C Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Build and Start Docker Compose
run: |
docker-compose up -d --build

- name: Run C Static Analysis
run: |
docker-compose exec -T app bash -c "dos2unix /workspace/ContinuousIntegration/run_c_static_code_analysis.sh && bash /workspace/ContinuousIntegration/run_c_static_code_analysis.sh"

- name: Copy C Analysis Reports to Host
run: |
docker cp app:/workspace/build/C_Lint_ReportApplicationOnly.txt .
docker cp app:/workspace/build/C_Lint_ReportFull.txt .

- name: Archive C Analysis Reports
uses: actions/upload-artifact@v3
with:
name: c-lint-reports
path: |
C_Lint_ReportApplicationOnly.txt
C_Lint_ReportFull.txt

- name: Clean Up Containers
run: |
docker-compose down

run-python-static-analysis:
name: Run Python Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Build and Start Docker Compose
run: |
docker-compose up -d --build

- name: Run Python Static Analysis
run: |
docker-compose exec -T app bash -c "dos2unix /workspace/ContinuousIntegration/run_python_static_code_analysis.sh && bash /workspace/ContinuousIntegration/run_python_static_code_analysis.sh"

- name: Copy Python Analysis Reports to Host
run: |
docker cp app:/workspace/build/python_lint_report ./python_lint_report

- name: Archive Python Analysis Reports
uses: actions/upload-artifact@v3
with:
name: python-lint-reports
path: python_lint_report

- name: Clean Up Containers
run: |
docker-compose down

run-shell-static-analysis:
name: Run Shell Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Build and Start Docker Compose
run: |
docker-compose up -d --build

- name: Run Shell Static Analysis
run: |
docker-compose exec -T app bash -c "dos2unix /workspace/ContinuousIntegration/run_shellscripts_static_code_analysis.sh && bash /workspace/ContinuousIntegration/run_shellscripts_static_code_analysis.sh"

- name: Copy Shell Analysis Report to Host
run: |
docker cp app:/workspace/build/Shell_Script_Lint_Report.txt Shell_Script_Lint_Report.txt

- name: Archive Shell Analysis Report
uses: actions/upload-artifact@v3
with:
name: shell-lint-report
path: Shell_Script_Lint_Report.txt

- name: Clean Up Containers
run: |
docker-compose down

build-firmware:
name: Build Firmware
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Build and Start Docker Compose
run: |
docker-compose up -d --build

- name: Build Firmware
run: |
docker-compose exec -T app bash -c "cd /workspace/build && cmake ../Software/Firmware/ && make -j$(nproc)"

- name: Copy Firmware Files to Host
run: |
docker cp app:/workspace/build/IonizationChamber.cdb .
docker cp app:/workspace/build/IonizationChamber.lk .
docker cp app:/workspace/build/IonizationChamber.ihx .
docker cp app:/workspace/build/IonizationChamber.map .

- name: Archive Firmware Build Artifacts
uses: actions/upload-artifact@v3
with:
name: firmware-build-artifacts
path: |
IonizationChamber.cdb
IonizationChamber.lk
IonizationChamber.ihx
IonizationChamber.map

- name: Clean Up Containers
run: |
docker-compose down
26 changes: 0 additions & 26 deletions .github/workflows/docs-generation.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/static-code-analysis.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions ContinuousIntegration/README.md

This file was deleted.

28 changes: 0 additions & 28 deletions ContinuousIntegration/run_generate_docs.sh

This file was deleted.

3 changes: 0 additions & 3 deletions ContinuousIntegration/run_python_static_code_analysis.sh

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions DevOps/ContinuousIntegration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ContinuousIntegration

This folder contains scripts used by GitHub Continuous Integration. It is recommended to run these scripts locally before submitting a pull request.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# shellcheck disable=SC1091
source /workspace/venv/bin/activate

flake8 --format=html --htmldir=python_lint_report /workspace/Software/MeasurementAcquisition/ /workspace/Simulation
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

shellcheck /workspace/ContinuousIntegration/*.sh | tee Shell_Script_Lint_Report.txt
Loading
Loading