mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-04-20 22:05:09 +00:00
Merge pull request #156 from lora-aprs/add_version_check
add version check
This commit is contained in:
commit
7bd5d1cbed
3 changed files with 48 additions and 2 deletions
13
.github/workflows/build_check.yml
vendored
13
.github/workflows/build_check.yml
vendored
|
|
@ -3,6 +3,17 @@ name: Integreation Tests
|
|||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
version_check:
|
||||
name: Version Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: check version
|
||||
run: ./scripts/check_version.py
|
||||
|
||||
build:
|
||||
name: Compile Firmware
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -41,7 +52,7 @@ jobs:
|
|||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Run clang-format style check for C/C++ programs.
|
||||
uses: jidicula/clang-format-action@v3.2.0
|
||||
uses: jidicula/clang-format-action@v4.5.0
|
||||
with:
|
||||
clang-format-version: '11'
|
||||
check-path: ${{ matrix.path }}
|
||||
|
|
|
|||
35
scripts/check_version.py
Executable file
35
scripts/check_version.py
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from datetime import date
|
||||
|
||||
today = date.today()
|
||||
|
||||
current_year = int(str(today.isocalendar()[0])[2:])
|
||||
current_week = int(today.isocalendar()[1])
|
||||
|
||||
version = None
|
||||
with open("src/LoRa_APRS_iGate.cpp") as f:
|
||||
for line in f:
|
||||
if line.startswith("#define VERSION"):
|
||||
version = line.strip().split(" ")[2].replace('"', "")
|
||||
|
||||
version_split = version.split(".")
|
||||
version_year = int(version_split[0])
|
||||
version_week = int(version_split[1])
|
||||
|
||||
print(f"firmware version year: {version_year}")
|
||||
print(f"firmware version week: {version_week}")
|
||||
|
||||
print(f"current year: {current_year}")
|
||||
print(f"current week: {current_week}")
|
||||
|
||||
error = False
|
||||
if version_year != current_year:
|
||||
print("firmware version is not current year!")
|
||||
error = True
|
||||
|
||||
if version_week != current_week:
|
||||
print("firmware version is not current week!")
|
||||
error = True
|
||||
|
||||
exit(error)
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
#include "TaskWifi.h"
|
||||
#include "project_configuration.h"
|
||||
|
||||
#define VERSION "21.50.0"
|
||||
#define VERSION "22.7.0"
|
||||
|
||||
String create_lat_aprs(double lat);
|
||||
String create_long_aprs(double lng);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue