Skip to content

Commit

Permalink
Adding github actions for build tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin710 committed Nov 26, 2024
1 parent 9aa7061 commit cbcd21b
Show file tree
Hide file tree
Showing 6 changed files with 269 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
58 changes: 58 additions & 0 deletions .github/workflows/build-all-on-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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: /Users/cfl/dev/emotibit/software/deploy/of_v0.11.2_osx_release/addons
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: /Users/cfl/dev/emotibit/software/deploy/of_v0.11.2_osx_release/addons/ofxEmotiBit
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
29 changes: 29 additions & 0 deletions .github/workflows/upload-build-artifact-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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: /Users/cfl/dev/emotibit/software/deploy/of_v0.11.2_osx_release/addons/ofxEmotiBit
working-directory: ${{ vars.OFXEMOTIBIT_DIR }}
run: mkdir -p stageRelease/EmotiBitSoftware-macos
- name: populate stage release
#working-directory: /Users/cfl/dev/emotibit/software/deploy/of_v0.11.2_osx_release/addons/ofxEmotiBit
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
12 changes: 12 additions & 0 deletions .github/workflows/win-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: CI

on:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
steps:
- name: bash
shell: bash
run: ls -la

0 comments on commit cbcd21b

Please sign in to comment.