Skip to content

Commit

Permalink
chore: remove references of output serial plotter
Browse files Browse the repository at this point in the history
  • Loading branch information
leon0399 committed Feb 19, 2024
1 parent dc59f87 commit 78431bb
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 98 deletions.
5 changes: 0 additions & 5 deletions .github/scripts/get_firmware_name.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ getBhapticsName() {
target="$target+battery"
fi

if [[ $flags =~ SENSESHIFT_SERIAL_PLOTTER=true ]]; then
echo "::debug::Serial Plotter is enabled, appending +serialplotter to the target"
target="$target+serialplotter"
fi

echo "firmware=$target"
if [[ -n "$GITHUB_ACTIONS" ]]; then
echo "firmware=$target" >> "$GITHUB_OUTPUT"
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
build-bhaptics:
name: Build ${{ matrix.target }} ${{ matrix.coverage && 'with coverage' || 'without coverage' }}, -D ${{ matrix.battery_flag }} -D ${{ matrix.serial_plotter_flag }} -D ${{ matrix.nimble_flag }}
name: Build ${{ matrix.target }} ${{ matrix.coverage && 'with coverage' || 'without coverage' }}, -D ${{ matrix.battery_flag }} -D ${{ matrix.nimble_flag }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -33,7 +33,6 @@ jobs:
- bhaptics_tactvisor
- bhaptics_tactglove_right
battery_flag: [ SENSESHIFT_BATTERY_ENABLED=true ]
serial_plotter_flag: [ SENSESHIFT_SERIAL_PLOTTER=false ]
nimble_flag: [ SENSESHIFT_BLE_USE_NIMBLE=false ]
coverage: [ false ]

Expand All @@ -43,19 +42,16 @@ jobs:
os: ubuntu-latest
coverage: true
battery_flag: SENSESHIFT_BATTERY_ENABLED=true
serial_plotter_flag: SENSESHIFT_SERIAL_PLOTTER=true
nimble_flag: SENSESHIFT_BLE_USE_NIMBLE=true
# - target: bhaptics_tactsuit_x40
# os: ubuntu-latest
# coverage: true
# battery_flag: SENSESHIFT_BATTERY_ENABLED=true
# serial_plotter_flag: SENSESHIFT_SERIAL_PLOTTER=true
# nimble_flag: SENSESHIFT_BLE_USE_NIMBLE=false
- target: bhaptics_tactsuit_x40
os: ubuntu-latest
coverage: false
battery_flag: SENSESHIFT_BATTERY_ENABLED=true
serial_plotter_flag: SENSESHIFT_SERIAL_PLOTTER=false
nimble_flag: SENSESHIFT_BLE_USE_NIMBLE=true

steps:
Expand All @@ -66,7 +62,7 @@ jobs:
- name: Get firmware name
id: firmware_name
run: |
./.github/scripts/get_firmware_name.sh ${{ matrix.target }} ${{ matrix.serial_plotter_flag }} ${{ matrix.battery_flag }} ${{ matrix.nimble_flag }}
./.github/scripts/get_firmware_name.sh ${{ matrix.target }} ${{ matrix.battery_flag }} ${{ matrix.nimble_flag }}
- name: Enable coverage (non-macOS)
if: runner.os != 'macOS' && matrix.coverage
Expand All @@ -81,13 +77,11 @@ jobs:
if: runner.os != 'macOS'
run: |
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.battery_flag }}/' platformio.ini
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.serial_plotter_flag }}/' platformio.ini
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.nimble_flag }}/' platformio.ini
- name: Update build flags (macOS)
if: runner.os == 'macOS'
run: |
sed -i '' '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.battery_flag }}/' platformio.ini
sed -i '' '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.serial_plotter_flag }}/' platformio.ini
sed -i '' '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.nimble_flag }}/' platformio.ini
- name: Speedup package installation
Expand Down
165 changes: 81 additions & 84 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,89 +32,86 @@ jobs:
# Enabling all flags to test build for every feature
battery_flag:
- SENSESHIFT_BATTERY_ENABLED=true
serial_plotter_flag:
- SENSESHIFT_SERIAL_PLOTTER=true

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: 'recursive'

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
# - run: git checkout HEAD^2
# if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-pio-${{ hashFiles('**/lockfiles') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Update build flags (non-macOS)
if: runner.os != 'macOS'
run: |
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.battery_flag }}/' platformio.ini
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.serial_plotter_flag }}/' platformio.ini
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
pio upgrade --dev
pio pkg update --global
- name: Build
run: |
pio run --environment bhaptics_tactsuit_x40
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: 'recursive'

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
# - run: git checkout HEAD^2
# if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-pio-${{ hashFiles('**/lockfiles') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Update build flags (non-macOS)
if: runner.os != 'macOS'
run: |
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.battery_flag }}/' platformio.ini
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
pio upgrade --dev
pio pkg update --global
- name: Build
run: |
pio run --environment bhaptics_tactsuit_x40
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
1 change: 0 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ build_flags =
-D CORE_DEBUG_LEVEL=3
; -D DEBUG_MODE=0
; -D DEBUG_ESP_PORT=Serial
; -D SENSESHIFT_SERIAL_PLOTTER=true
; -D SENSESHIFT_BATTERY_ENABLED=true
; -D SENSESHIFT_BLE_USE_NIMBLE=true

Expand Down

0 comments on commit 78431bb

Please sign in to comment.