From 349fe504ae4fb28dba2e48bf3c7f2c1af132757f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rudowicz?= Date: Sun, 11 Feb 2024 14:41:18 +0100 Subject: [PATCH] Add pre-commit to CI --- .build.yml | 14 +++++++++++--- .pre-commit-config.yaml | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.build.yml b/.build.yml index 0eb8cb6..4fbff1f 100644 --- a/.build.yml +++ b/.build.yml @@ -1,10 +1,21 @@ image: alpine/latest packages: - go + - python3-dev tasks: - go-get: | cd hswro-alarm-bot go get -t + - precommit: | + cd hswro-alarm-bot + python3 -m venv .venv + source .venv/bin/activate + pip3 install pre-commit + pre-commit install + pre-commit run -a + - test: | + cd hswro-alarm-bot + go test --count=10000 - build-x86_64: | cd hswro-alarm-bot env GOOS=linux GOARCH=amd64 go build -o alarm_bot.x86-64 @@ -20,9 +31,6 @@ tasks: - build-arm8: | cd hswro-alarm-bot env GOOS=linux GOARCH=arm64 go build -o alarm_bot.arm8 - - test: | - cd hswro-alarm-bot - go test --count=10000 artifacts: - hswro-alarm-bot/alarm_bot.x86-64 - hswro-alarm-bot/alarm_bot.arm5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f1d7437..26e6611 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,3 +13,4 @@ repos: - id: go-fmt args: [ -w ] - id: go-vet-mod + - id: go-test-repo-mod