Skip to content

Commit 67d750e

Browse files
authored
Updated workflow versions (#361)
1 parent 754e591 commit 67d750e

5 files changed

Lines changed: 29 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ permissions:
2121

2222
jobs:
2323
build-and-verify:
24-
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/build-and-verify.yml@v1.0.0
24+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/build-and-verify.yml@v1.0.1
2525
secrets:
2626
QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_COVERAGE_TOKEN }}
2727
with:
2828
program: cbuild2cmake
2929
go-version-file: ./go.mod
30-
enable-code-climate: true
31-
artifact-retention-days: 7
30+
enable-qlty-coverage: true
3231

3332
publish-test-results:
3433
name: "Publish Tests Results"

.github/workflows/markdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions: read-all
1212

1313
jobs:
1414
markdown-check:
15-
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/markdown-lint.yml@v1.0.0
15+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/markdown-lint.yml@v1.0.1
1616
with:
1717
lint-config: '.github/markdownlint.jsonc'
1818
link-check-config: '.github/markdown-link-check.jsonc'

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ on:
1212

1313
jobs:
1414
build-and-verify:
15-
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/build-and-verify.yml@v1.0.0
15+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/build-and-verify.yml@v1.0.1
1616
with:
1717
program: cbuild2cmake
1818
go-version-file: ./go.mod
19-
enable-code-climate: false
19+
enable-qlty-coverage: false
2020

2121
goreleaser:
2222
needs: [ build-and-verify ]

.github/workflows/update-workflows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ permissions:
1111

1212
jobs:
1313
update-workflows:
14-
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/update-workflow.yml@v1.0.0
14+
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/update-workflow.yml@v1.0.1
1515
secrets:
16-
TOKEN_ACCESS: ${{ secrets.GITHUB_TOKEN }}
16+
TOKEN_ACCESS: ${{ secrets.GRASCI_WORKFLOW_UPDATE }}

makefile

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
OS ?= $(shell uname)
33

44
# Having this will allow CI scripts to build for many OS's and ARCH's
5-
ARCH := $(or $(ARCH),amd64)
5+
ARCH ?= $(shell uname -m)
6+
7+
# Retrieve version from git history
8+
VERSION ?= $(shell git describe --tags 2>/dev/null || echo unknown)
69

710
# Path to lint tool
811
GOLINTER ?= golangci-lint
@@ -20,6 +23,14 @@ else
2023
# Default to Linux
2124
OS=linux
2225
endif
26+
ifneq (,$(findstring x86_64,$(ARCH)))
27+
ARCH=amd64
28+
else ifneq (,$(findstring aarch64,$(ARCH)))
29+
ARCH=arm64
30+
else ifneq (,$(findstring unknown,$(ARCH)))
31+
# fallback
32+
ARCH=amd64
33+
endif
2334

2435
SOURCES := $(wildcard cmd/cbuild2cmake/*.go) $(wildcard pkg/*/*.go)
2536

@@ -53,7 +64,8 @@ all:
5364

5465
$(PROG): $(SOURCES)
5566
@echo Building project
56-
GOOS=$(OS) GOARCH=$(ARCH) go build -ldflags "-X main.version=`git describe 2>/dev/null || echo unknown`" -o $(PROG) ./cmd/cbuild2cmake
67+
GOOS=$(OS) GOARCH=$(ARCH) go build -ldflags "-X main.version=$(VERSION)" -o $(PROG) ./cmd/cbuild2cmake
68+
5769

5870
build: $(PROG)
5971

@@ -67,21 +79,22 @@ format:
6779
$(GOFORMATTER) -s -w .
6880

6981
format-check:
70-
mkdir -p build && $(GOFORMATTER) -d . | tee build/format-check.out
71-
test ! -s build/format-check.out
82+
$(GOFORMATTER) -d . | tee format-check.out
83+
test ! -s format-check.out
7284

7385
.PHONY: test release config
7486
test: $(SOURCES)
75-
mkdir -p build && GOOS=$(OS) GOARCH=$(ARCH) go test $(ARGS) -v ./... -coverprofile build/cover.out
87+
GOOS=$(OS) GOARCH=$(ARCH) go test $(ARGS) -v ./... -coverprofile ./cover.out
7688

7789
test-all: format-check coverage-check lint
7890

7991
coverage-report: test
80-
go tool cover -html=build/cover.out
92+
go tool cover -html=./cover.out
8193

8294
coverage-check: test
95+
@echo "Current coverage is: $(shell go tool cover -func ./cover.out | tail -1 | awk '{print ($$3 + 0)}')"%
8396
@echo Checking if test coverage is above 80%
84-
test `go tool cover -func build/cover.out | tail -1 | awk '{print ($$3 + 0)*10}'` -ge 800
97+
test `go tool cover -func ./cover.out | tail -1 | awk '{print ($$3 + 0)*10}'` -ge 800
8598

8699
release: test-all $(PROG)
87100
@./scripts/release
@@ -93,5 +106,6 @@ config:
93106

94107
# Install pre-commit hooks
95108
cp scripts/pre-commit .git/hooks/pre-commit
109+
96110
clean:
97-
rm -rf build
111+
rm -rf build/*

0 commit comments

Comments
 (0)