Skip to content

CI

CI #75

Workflow file for this run

name: CI
on: [workflow_dispatch]
jobs:
ci:
name: Ecowitt gateway driver test on ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Install packages
run: |
sudo apt update
sudo apt install --yes --no-install-recommends \
python3-pip \
python3-venv
- name: Checkout weewx-gw1000 repo
uses: actions/checkout@v4
- name: Python version
uses: actions/setup-python@v5
with:
python-version : ${{ matrix.python-version }}
- name: Install WeeWX and setup the test environment
run: |
# install WeeWX in a venv via pip
python3 -m venv ~/weewx-venv
source ~/weewx-venv/bin/activate
python3 -m pip install weewx
# create a station
weectl station create --driver=weewx.drivers.simulator \
--location=CI \
--altitude=46,meter \
--latitude=-27 \
--longitude=152 \
--register=n \
--units=us \
--no-prompt
# install the Gateway driver extension
weectl extension install ~/work/weewx-gw1000/weewx-gw1000 --yes
# create a directory to hold the test suites, it is not created by the installer
mkdir ~/weewx-data/bin/user/tests
# copy the test suite file
cp ~/work/weewx-gw1000/weewx-gw1000/bin/user/tests/test_egd.py ~/weewx-data/bin/user/tests/
- name: Launch test suite
run: |
# activate the venv
source ~/weewx-venv/bin/activate
# run the test suite
PYTHONPATH=~/weewx-data/bin python3 -m user.tests.test_egd
# - name: Archive test-results
# if: success() || failure()
# uses: actions/upload-artifact@v3
# with:
# name: test-results
# path: build/test-results