add door switch method #36
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: lint | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
setup: | |
name: Set up | |
runs-on: ubuntu-latest | |
env: | |
MQTT_BROKER_ADDRESS: 127.0.0.1:1883 | |
# services: | |
# mosquitto: | |
# image: ghcr.io/niwaniwa/sakura-gateway:v1 | |
# ports: | |
# - 1883:1883 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21 | |
- name: Set up dependencies | |
run: | | |
sudo apt update | |
sudo apt install pkg-config libusb-1.0-0-dev | |
- name: Get dependencies | |
run: go get -v -t -d ./... | |
- name: Download Mosquitto config | |
run: wget -O mosquitto.conf https://raw.githubusercontent.com/niwaniwa/Sakura-Gateway/main/mosquitto.conf | |
- name: Run mosquitto | |
run: docker run -d -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mqtt/config --name mqtt toke/mosquitto | |
# Goのテストを実行 | |
- name: Run tests | |
run: go test ./... | |
golangci: | |
name: golangci lint check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up dependencies | |
run: | | |
sudo apt update | |
sudo apt install pkg-config libusb-1.0-0-dev | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v2 | |
with: | |
version: latest | |
args: ./... |