Skip to content

Commit

Permalink
Merge pull request #16 from KSU-MS/feature/auto-get-dbc
Browse files Browse the repository at this point in the history
big big overhaul
  • Loading branch information
mathbrook authored Feb 16, 2024
2 parents ebe03ec + f3768a1 commit 6327038
Show file tree
Hide file tree
Showing 25 changed files with 173,862 additions and 2,341 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/build-exe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: build and run windows executable

on:
push:
branches: "main"
pull_request:
branches: "main"

jobs:
build:

runs-on: windows-latest

steps:
- name: checkout code
uses: actions/checkout@v2

# - name: Get current date and time
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H_%M_%S')"
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ github.ref_name }}-${{ steps.date.outputs.date }}
# files: ./*

# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.8' # Replace '3.x' with your Python version

# - name: install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt

# - name: run pyinstaller
# run: |
# pyinstaller --onefile ./parser_exe.py
# - name: check what files we cooked up
# run: |
# ls -R
- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip freeze
- name: run pyinstaller
run: |
pyinstaller --onefile ./parser_exe.py
- name: copy test into dist folder
run: |
ls -r
mkdir .\dist\test
xcopy ".\test" ".\dist\test" /E
- name: release-downloader
uses: robinraju/[email protected]
with:
repository:
KSU-MS/ksu-ms-dbc
latest: true
fileName: "*.dbc"
out-file-path: |
./dist/dbc-files/
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: parser-exe-windows
path: |
./dist/*
./build/*
test-exe:
needs: build
runs-on: windows-latest
steps:
- name: download artifact
uses: actions/download-artifact@v2
with:
name: parser-exe-windows
path: parser-exe-download
- name: run executable # watch the - and _ here lol
run: |
ls -r
cd parser-exe-download
cd dist
.\parser_exe.exe -h
.\parser_exe.exe --getdbc --test -v
# - uses: actions/upload-artifact@v2
# with:
# name: parser-exe-linux
# path: |
# ./build/*
# ./dist/parser_exe
86 changes: 86 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: build and run linux executable

on:
push:
branches: "main"
pull_request:
branches: "main"

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: checkout code
uses: actions/checkout@v2

# - name: Get current date and time
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H_%M_%S')"
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ github.ref_name }}-${{ steps.date.outputs.date }}
# files: ./*

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8' # Replace '3.x' with your Python version

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: get dbc from latest release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: KSU-MS/ksu-ms-dbc

- name: run pyinstaller
run: |
pyinstaller --onefile ./parser_exe.py
- name: check what files we cooked up
run: |
ls -R
cp -r ./test ./dist
- name: release-downloader
uses: robinraju/[email protected]
with:
repository:
KSU-MS/ksu-ms-dbc
latest: true
fileName: "*.dbc"
out-file-path: |
./dist/dbc-files
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: parser-exe-linux
path: |
./build/*
./dist/*
test-bin:
needs: build
runs-on: ubuntu-latest
steps:
- name: download artifact
uses: actions/download-artifact@v2
with:
name: parser-exe-linux
path: parser-exe-download
- name: run executable
run: |
cd parser-exe-download
cd dist
chmod u+x ./parser_exe
./parser_exe -h
./parser_exe --getdbc --test -v
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: generate DBC and C code

on:
push:
branches:
- main # Replace 'main' with your main branch name a

jobs:
build:
runs-on: ubuntu-latest # You can change the OS if needed

steps:
- name: Checkout code
uses: actions/checkout@v4 # This action checks out your repository's code

- name: Get current date and time
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H_%M_%S')"
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}-${{ steps.date.outputs.date }}
files: |
./*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,6 @@ telemetry_parsers/__pycache__/parser_api.cpython-310.pyc
telemetry_parsers/__pycache__/parser_api.cpython-310.pyc
*.mat
*.fig
.venv/pyvenv.cfg
*.cfx
**/*.dbf
File renamed without changes.
Loading

0 comments on commit 6327038

Please sign in to comment.