Skip to content

Commit

Permalink
Feat GitHub actions (#263)
Browse files Browse the repository at this point in the history
* Adding github actions for build tests

* updates to actions

* removed test workflow
  • Loading branch information
nitin710 authored Dec 6, 2024
1 parent 9aa7061 commit 82c0dc4
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-all-on-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build all on linux
on: [push]
jobs:
clone-to-OF_ROOT:
runs-on: [self-hosted, Linux]
environment: RUNNER-LINUX
steps:
- name: remove existing clone
working-directory: ${{ vars.ADDONS_DIR }}
run: |
pwd
#echo "the commit that dispatched this job-- ${GITHUB_SHA}"
if [ -d ofxEmotiBit ]; then
echo "Directory exists."
rm -rf ofxEmotiBit
echo "clone removed"
else
echo "Directory does not already exist"
fi
- name: checkout repository
uses: actions/checkout@v4
- name: move fresh clone to OF_ROOT
run: cp -r ../$(echo ${{ github.repository }} | cut -d '/' -f 2) ${{ vars.ADDONS_DIR }}
build-oscilloscope:
needs: clone-to-OF_ROOT
runs-on: [self-hosted, Linux]
environment: RUNNER-LINUX
steps:
- name: build using make
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
echo "current working directory" && pwd
cd EmotiBitOscilloscope
make
build-dataparser:
needs: clone-to-OF_ROOT
runs-on: [self-hosted, Linux]
environment: RUNNER-LINUX
steps:
- name: build using make
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
echo "current working directory" && pwd
cd EmotiBitDataParser
make
56 changes: 56 additions & 0 deletions .github/workflows/build-all-on-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build all on macos
on: [push]
jobs:
clone-to-OF_ROOT:
runs-on: [self-hosted, macOS]
environment: RUNNER-MACOS
steps:
- name: remove existing clone
working-directory: ${{ vars.ADDONS_DIR }}
run: |
pwd
#echo "the commit that dispatched this job-- ${GITHUB_SHA}"
if [ -d ofxEmotiBit ]; then
echo "Directory exists."
rm -rf ofxEmotiBit
echo "clone removed"
else
echo "Directory does not already exist"
fi
- name: checkout repository
uses: actions/checkout@v4
- name: move fresh clone to OF_ROOT
run: cp -r ../$(echo ${{ github.repository }} | cut -d '/' -f 2) ${{ vars.ADDONS_DIR }}
build-oscilloscope:
needs: clone-to-OF_ROOT
runs-on: [self-hosted, macOS]
environment: RUNNER-MACOS
steps:
- name: build using xcode
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
echo "current working directory" && pwd
cd EmotiBitOscilloscope
xcodebuild -project EmotiBitOscilloscope.xcodeproj -scheme Release-x86_64
build-dataparser:
needs: clone-to-OF_ROOT
runs-on: [self-hosted, macOS]
environment: RUNNER-MACOS
steps:
- name: build using xcode
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
echo "current working directory" && pwd
cd EmotiBitDataParser
xcodebuild -project EmotiBitDataParser.xcodeproj -scheme Release
build-firmwareinstaller:
needs: clone-to-OF_ROOT
runs-on: [self-hosted, macOS]
environment: RUNNER-MACOS
steps:
- name: build using xcode
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
echo "current working directory" && pwd
cd EmotiBitFirmwareInstaller
xcodebuild -project EmotiBitFirmwareInstaller.xcodeproj -scheme Release
63 changes: 63 additions & 0 deletions .github/workflows/build-all-on-win.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build all on Windows
on: [push]
jobs:
clone-to-OF_ROOT:
runs-on: [self-hosted, Windows]
environment: RUNNER-WINDOWS
steps:
- name: remove existing clone
shell: bash
working-directory: ${{ vars.ADDONS_DIR }}
run: |
pwd
#echo "the commit that dispatched this job-- ${GITHUB_SHA}"
if [ -d ofxEmotiBit ]; then
echo "Directory exists."
rm -rf ofxEmotiBit
echo "clone removed"
else
echo "Directory does not already exist"
fi
- name: checkout repository
uses: actions/checkout@v4
- name: move fresh clone to OF_ROOT
shell: bash
run: |
echo ${{ github.repository }} | cut -d '/' -f 2
cp -r ..\\$(echo ${{ github.repository }} | cut -d '/' -f 2) ${{ vars.ADDONS_DIR }}
build-oscilloscope:
needs: clone-to-OF_ROOT
runs-on: [self-hosted, Windows]
environment: RUNNER-WINDOWS
steps:
- name: build using MSBuild
shell: cmd
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
echo "current working directory" && pwd
cd EmotiBitOscilloscope
MSBuild EmotiBitOscilloscope.sln -t:Build -p:Configuration=Release
build-dataparser:
needs: clone-to-OF_ROOT
runs-on: [self-hosted, Windows]
environment: RUNNER-WINDOWS
steps:
- name: build using MSBuild
shell: cmd
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
echo "current working directory" && pwd
cd EmotiBitDataParser
MSBuild EmotiBitDataParser.sln -t:Build -p:Configuration=Release
build-firmwareinstaller:
needs: clone-to-OF_ROOT
runs-on: [self-hosted, Windows]
environment: RUNNER-WINDOWS
steps:
- name: build using MSBuild
shell: cmd
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
echo "current working directory" && pwd
cd EmotiBitFirmwareInstaller
MSBuild EmotiBitFirmwareInstaller.sln -t:Build -p:Configuration=Release
27 changes: 27 additions & 0 deletions .github/workflows/upload-build-artifact-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: upload build artifact mac
on:
workflow_run:
workflows: ["Build all on macos"]
types:
- completed
branches:
[dev]
jobs:
upload-artifact:
runs-on: [self-hosted, macOS]
environment: RUNNER-MACOS
steps:
- name: create stage-release
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: mkdir -p stageRelease/EmotiBitSoftware-macos
- name: populate stage release
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
mv EmotiBitOscilloscope/bin/EmotiBitOscilloscope.app stageRelease/EmotiBitSoftware-macos
mv EmotiBitDataParser/bin/EmotiBitDataParser.app stageRelease/EmotiBitSoftware-macos
mv EmotiBitFirmwareInstaller/bin/EmotiBitFirmwareInstaller.app stageRelease/EmotiBitSoftware-macos
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: EmotiBitSoftware-macos
path: ${{ vars.OFXEMOTIBIT_DIR }}/stageRelease/EmotiBitSoftware-macos/
62 changes: 62 additions & 0 deletions .github/workflows/upload-build-artifact-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: upload build artifact Windows
on:

#workflow_dispatch:
workflow_run:
workflows: ["Build all on Windows"]
types:
- completed
branches:
[dev]
jobs:
build-installer:
runs-on: [self-hosted, Windows]
environment: RUNNER-WINDOWS
steps:
- name: build installer project
shell: cmd
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
cd EmotiBitInstaller
devenv EmotiBitInstaller.sln /Build Release
upload-artifact:
needs: build-installer
runs-on: [self-hosted, Windows]
environment: RUNNER-WINDOWS
steps:
- name: create stage-release
shell: bash
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: mkdir -p stageRelease/EmotiBitSoftware-Windows
- name: populate stage release
shell: bash
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: |
msiInstPath=./EmotiBitInstaller/EmotiBitInstaller/Release/EmotiBitInstaller.msi
setupPath=./EmotiBitInstaller/EmotiBitInstaller/Release/setup.exe
silabsDriverPath=../../../drivers/CP210x_Windows_Drivers
releaseFolder="EmotiBitSoftware-Windows"
version=$(grep ./src/ofxEmotiBitVersion.h -e "string ofxEmotiBitVersion" | cut -d '"' -f 2)
echo "Staging release for version: $version"
if [ -f "$msiInstPath" ] || [ -f "$setupPath" ]; then
echo "msi and exe files found!"
echo "staging release"
echo "copying installer files"
cp "$msiInstPath" "./stageRelease/$releaseFolder"
cp "$setupPath" "./stageRelease/$releaseFolder"
for i in $(find ../../../drivers -maxdepth 1 -mindepth 1 -name '*CP210x*' -type d); do
dirname=$(basename "$i")
worktree="../../../drivers/$dirname"
echo "copying $dirname"
cp -r "$worktree" "./stageRelease/$releaseFolder"
done
else
echo "installer files not found! Create installer!"
fi
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: EmotiBitSoftware-Windows
path: ${{ vars.OFXEMOTIBIT_DIR }}\\stageRelease\\EmotiBitSoftware-Windows

0 comments on commit 82c0dc4

Please sign in to comment.