Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export MQTT_BROKER=localhost
export MQTT_PORT=1883
export MQTT_CLIENT_ID=gatecontrol
export MQTT_USERNAME=faacuser
export MQTT_PASSWORD=<your_password_here>
export MQTT_BASE_TOPIC=faac/gate
export LOG_LEVEL=info

export SPI_BUS=0
export SPI_CHIP_SELECT=0
export SPI_HARDWARE_ADDR=0
export DIDO_RELAY_PIN=0
export SPI_SPEED_HZ=100000
export PULSE_LENGTH_MS=500

# Local development only.
export USE_MOCK_DIDO=true
export USE_MOCK_MQTT=true
44 changes: 17 additions & 27 deletions .github/workflows/gatecontrol.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: gatecontrol

on:
Expand All @@ -9,31 +6,24 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
python -m unittest discover -s app/tests
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.x"
cache: true

- name: Verify module files
run: go mod tidy -diff

- name: Test
run: go test ./...

- name: Build ARMv6 binary
run: |
GOOS=linux GOARCH=arm GOARM=6 CGO_ENABLED=0 \
go build -o bin/gatecontrol-armv6 ./cmd/gatecontrol
Loading
Loading