FreeDATA/.github/workflows/build-project-linux.yml

117 lines
3.2 KiB
YAML
Raw Normal View History

2022-02-25 09:29:38 +00:00
name: Linux
2021-08-28 08:51:29 +00:00
on:
push:
2022-02-25 09:29:38 +00:00
tags:
Enhance tests (#185) * Initial attempt to create unit tests for DATA class (tnc). * Completed initial set of tests. * Adding pytest to install packages. * Corrects issue #173 fix I didn't look carefully enough at `helpers.check_callsign` to see that it returns a list. The first element of the list is `True`/`False`. * Making check_callsign evaluation more consistent. * Update .gitignore this is more a test commit to see if GitHub Client for MacOS is working, * mkfifo test prototype First partially working prototype for testing the full tnc with mkfifo named pipes. * single tnc test file moved to a single file for running tnc tests * fixed typo * Added parameters to tests. Make other minor tweaks and documentation. * Clean up two existing tests. Adapted both tests to pytest and maintained compatibility with existing ctest method. Tweaked CMakeLists.txt . * Adding pure python highsnr_stdio_P_P_multi test. Intended to replace highsnr_stdio_P_P_multi which uses POSIX shell. * Adding pure python highsnr_stdio_P_P_datac0 test. Intended to replace highsnr_stdio_P_P_datac0 which uses POSIX shell. * Parameterize recent tests. Renamed datac0 to datacx after including all data codecs in test. * Parameterize mode as well. Add ability to run tests from main directory as well as within test/. * Add list of tests and brief descriptions. * Add more native python tests conversions. * Update README with new tests. * Tweak README again. * Rename test to be findable by pytest. * Rename test for ctest. * Update correct file this time. * Minor test tweaks. * Add modem test proof-of-concept. * Adjustment to ARQ short test. * Various refactorings. Type hints, trailing backslash, range usage, etc. * Ignore unknown arguments in argparse. * Minor cleanups. * Update test/README.md. * Update test_pa to quiet pylint. * Give up trying to suppress structlog output. * Correct module comments. * Remove excess trailing spaces. * Remove excess newlines. * Various refactorings. Type hints, trailing backslash, range usage, etc. * mkfifo test prototype First partially working prototype for testing the full tnc with mkfifo named pipes. * Update test_tnc and tweak IRS/ISS. * Correct test_modem to detect failures. * Trying to be less dependent on env variables. * Add IRS/ISS tests to ctests * Pin codec2 revision to v1.0.3. * Correcting git mistake. * Pin codec2 revision to master. This should be a specific release, that implements freedv_set_tuning_range. Co-authored-by: DJ2LS <75909252+DJ2LS@users.noreply.github.com>
2022-05-21 23:04:17 +00:00
- "v*"
2022-05-18 22:33:54 +00:00
2021-08-28 07:44:35 +00:00
jobs:
2021-09-11 15:08:41 +00:00
build_linux_release:
name: Build Linux release
2021-08-28 07:44:35 +00:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
2021-08-28 07:44:35 +00:00
include:
- os: ubuntu-20.04
2021-08-28 10:54:40 +00:00
zip_name: ubuntu_tnc
2021-08-28 07:44:35 +00:00
generator: Unix Makefiles
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
Enhance tests (#185) * Initial attempt to create unit tests for DATA class (tnc). * Completed initial set of tests. * Adding pytest to install packages. * Corrects issue #173 fix I didn't look carefully enough at `helpers.check_callsign` to see that it returns a list. The first element of the list is `True`/`False`. * Making check_callsign evaluation more consistent. * Update .gitignore this is more a test commit to see if GitHub Client for MacOS is working, * mkfifo test prototype First partially working prototype for testing the full tnc with mkfifo named pipes. * single tnc test file moved to a single file for running tnc tests * fixed typo * Added parameters to tests. Make other minor tweaks and documentation. * Clean up two existing tests. Adapted both tests to pytest and maintained compatibility with existing ctest method. Tweaked CMakeLists.txt . * Adding pure python highsnr_stdio_P_P_multi test. Intended to replace highsnr_stdio_P_P_multi which uses POSIX shell. * Adding pure python highsnr_stdio_P_P_datac0 test. Intended to replace highsnr_stdio_P_P_datac0 which uses POSIX shell. * Parameterize recent tests. Renamed datac0 to datacx after including all data codecs in test. * Parameterize mode as well. Add ability to run tests from main directory as well as within test/. * Add list of tests and brief descriptions. * Add more native python tests conversions. * Update README with new tests. * Tweak README again. * Rename test to be findable by pytest. * Rename test for ctest. * Update correct file this time. * Minor test tweaks. * Add modem test proof-of-concept. * Adjustment to ARQ short test. * Various refactorings. Type hints, trailing backslash, range usage, etc. * Ignore unknown arguments in argparse. * Minor cleanups. * Update test/README.md. * Update test_pa to quiet pylint. * Give up trying to suppress structlog output. * Correct module comments. * Remove excess trailing spaces. * Remove excess newlines. * Various refactorings. Type hints, trailing backslash, range usage, etc. * mkfifo test prototype First partially working prototype for testing the full tnc with mkfifo named pipes. * Update test_tnc and tweak IRS/ISS. * Correct test_modem to detect failures. * Trying to be less dependent on env variables. * Add IRS/ISS tests to ctests * Pin codec2 revision to v1.0.3. * Correcting git mistake. * Pin codec2 revision to master. This should be a specific release, that implements freedv_set_tuning_range. Co-authored-by: DJ2LS <75909252+DJ2LS@users.noreply.github.com>
2022-05-21 23:04:17 +00:00
ref: main
2022-05-18 22:33:54 +00:00
- name: Set up Python 3.8
2021-08-28 08:57:00 +00:00
uses: actions/setup-python@v2
with:
2022-05-18 22:33:54 +00:00
python-version: 3.8
2021-08-28 07:44:35 +00:00
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-20.04'
2021-08-28 07:44:35 +00:00
run: |
2021-08-29 13:54:23 +00:00
sudo apt install portaudio19-dev libhamlib-dev libhamlib-utils build-essential cmake python3-libhamlib2
2021-08-28 07:44:35 +00:00
python -m pip install --upgrade pip
pip3 install pyaudio
pip3 install psutil
pip3 install crcengine
2022-05-18 22:33:54 +00:00
pip3 install 'pyinstaller<5.1'
2021-08-28 13:01:39 +00:00
pip3 install ujson
2021-09-04 20:13:42 +00:00
pip3 install pyserial
2021-09-05 12:53:07 +00:00
pip3 install numpy
2021-11-18 18:46:07 +00:00
pip3 install structlog
2022-03-29 14:44:33 +00:00
pip3 install sounddevice
2021-08-29 13:31:42 +00:00
2021-09-02 18:15:33 +00:00
#- name: Build Hamlib Python Binding
# if: matrix.os == 'ubuntu-latest'
# working-directory: tnc
2022-05-18 22:33:54 +00:00
# run: |
2021-09-02 18:15:33 +00:00
# sudo apt install wig libtool
# cd ~
# git clone https://github.com/Hamlib/Hamlib.git
# cd Hamlib
# ./bootstrap
# ./configure --with-python-binding PYTHON_VERSION='3.9' --prefix=$HOME/local
# make
# make install
2022-05-18 22:33:54 +00:00
2021-08-28 12:34:23 +00:00
- name: Build codec2 Linux
if: matrix.os == 'ubuntu-20.04'
working-directory: tnc
2021-08-28 12:34:23 +00:00
run: |
git clone https://github.com/drowe67/codec2.git
cd codec2 && git checkout master && mkdir build_linux && cd build_linux
2021-08-28 12:34:23 +00:00
cmake ../
make
2022-05-18 22:33:54 +00:00
- name: Build Linux Daemon
if: matrix.os == 'ubuntu-20.04'
2021-09-05 13:34:28 +00:00
working-directory: tnc
2022-05-18 22:33:54 +00:00
run: |
pyinstaller freedata.spec
2022-05-18 22:33:54 +00:00
2021-08-28 12:37:53 +00:00
- name: LIST ALL FILES
shell: bash
run: |
2022-05-18 22:33:54 +00:00
ls -R
2021-08-28 07:44:35 +00:00
- name: Compress Linux
shell: bash
run: |
cd ./tnc/dist
2021-08-28 10:44:12 +00:00
mkdir compressed
zip -r ./compressed/${{ matrix.zip_name }}.zip *
2021-08-28 10:54:40 +00:00
- name: Upload Ubuntu TNC artifacts
2021-08-28 10:44:12 +00:00
uses: actions/upload-artifact@v2
with:
2021-08-28 10:47:34 +00:00
name: tnc-artifact
path: ./tnc/dist/compressed/*
2022-05-18 22:33:54 +00:00
2021-08-28 12:58:39 +00:00
- name: Copy TNC to GUI Linux
if: matrix.os == 'ubuntu-20.04'
2022-05-18 22:33:54 +00:00
run: |
cp -R ./tnc/dist/tnc ./gui/tnc
2022-05-18 22:33:54 +00:00
ls -R
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 16
2022-02-25 08:28:42 +00:00
2022-05-18 22:33:54 +00:00
- name: Release TNC
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
2022-05-18 22:33:54 +00:00
files: ./tnc/dist/compressed/${{ matrix.zip_name }}.zip
2021-08-28 10:58:46 +00:00
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
package_root: "./gui/"
2021-08-28 11:06:43 +00:00
github_token: ${{ secrets.github_token }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
2022-02-25 09:29:38 +00:00
args: "-p always"