From d0194cd06db63641dd493d0303d7d5996e6e0e90 Mon Sep 17 00:00:00 2001 From: David Ferlay Date: Thu, 6 Jun 2024 10:16:48 +0200 Subject: [PATCH] Adding github action CI testing --- .github/workflows/commit.yml | 64 ++++++++++++++++++++++++++++++++++++ .gitignore | 3 +- Makefile | 2 +- 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/commit.yml diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml new file mode 100644 index 0000000..eba12f8 --- /dev/null +++ b/.github/workflows/commit.yml @@ -0,0 +1,64 @@ +name: Commit Workflow + +on: + push: + workflow_dispatch: + +jobs: + + commands-ok: + name: Ensure main commands do not fail + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Commands + run: | + set -x + date + pwd + whoami + make deps build + ls -lah bin/launchr + mkdir -p .compose/build/ + touch .compose/build/test + ./bin/launchr package + export file="$(ls -t .compose/artifacts/ | head -n 1)"; echo ${file} + tar -tf .compose/artifacts/${file} + + go-linters: + name: Run linters + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Commands + run: | + set -x + date + pwd + whoami + make lint + + go-tests: + name: Run Go tests + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Commands + run: | + set -x + date + pwd + whoami + make test + diff --git a/.gitignore b/.gitignore index 30dd966..012c981 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ *.gz *.gen.go dist/ -vendor/ \ No newline at end of file +vendor/ +.compose/ diff --git a/Makefile b/Makefile index e466897..89044d6 100644 --- a/Makefile +++ b/Makefile @@ -74,4 +74,4 @@ endif .PHONY: .lint .lint: $(info Running lint...) - $(GOLANGCI_BIN) run --fix ./... + $(GOLANGCI_BIN) run --fix --timeout 3m0s ./...