From 04302cb41d518e587eced71f737e10bf420f39f7 Mon Sep 17 00:00:00 2001 From: danijelTxFusion Date: Fri, 23 Feb 2024 16:00:03 +0100 Subject: [PATCH] ci(go): use `make` tool --- .github/workflows/test-go.yml | 2 +- .github/workflows/test-js.yml | 2 +- .github/workflows/validate.yml | 13 +------------ go/Makefile | 9 +++++++++ 4 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 go/Makefile diff --git a/.github/workflows/test-go.yml b/.github/workflows/test-go.yml index 6f14903..40d21a6 100644 --- a/.github/workflows/test-go.yml +++ b/.github/workflows/test-go.yml @@ -28,4 +28,4 @@ jobs: docker-compose up -d popd - name: Run tests - run: cd go && go test ./test/... \ No newline at end of file + run: cd go && make run-tests \ No newline at end of file diff --git a/.github/workflows/test-js.yml b/.github/workflows/test-js.yml index 5830a68..c06db96 100644 --- a/.github/workflows/test-js.yml +++ b/.github/workflows/test-js.yml @@ -1,4 +1,4 @@ -name: Run tests +name: Run tests JS on: workflow_dispatch: pull_request: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c24e85e..79f1f73 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -19,18 +19,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4.0.0 - name: Run gofmt - run: | - cd go - fmt_output=$(gofmt -l .) - - if [ -n "$fmt_output" ]; then - echo "Code not formatted correctly:" - echo "$fmt_output" - exit 1 - else - echo "Code is formatted correctly" - exit 0 - fi + run: cd go && make check-format lint-js: name: Check code format for JavaScript runs-on: ubuntu-latest diff --git a/go/Makefile b/go/Makefile new file mode 100644 index 0000000..720818a --- /dev/null +++ b/go/Makefile @@ -0,0 +1,9 @@ + +run-tests: + go test ./test -v + +check-format: + cd scripts/ && ./check-format.sh && cd ../.. + +format: + gofmt -w .