ci: use cue version from go.mod
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
14f535655d
commit
408053f092
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@ -17,16 +17,21 @@ jobs:
|
|||||||
go-version: 1.16
|
go-version: 1.16
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y --no-install-recommends shellcheck
|
sudo apt-get install -y --no-install-recommends shellcheck
|
||||||
|
|
||||||
|
export CUE_VERSION="$(grep cue ./go.mod | cut -d' ' -f2)"
|
||||||
|
export CUE_TARBALL="cue_$(echo "$CUE_VERSION" | sed 's/^v//')_Linux_x86_64.tar.gz"
|
||||||
|
|
||||||
|
echo "Installing cue version $CUE_VERSION"
|
||||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sudo sh -s -- -b /usr/local/bin v1.23.8
|
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sudo sh -s -- -b /usr/local/bin v1.23.8
|
||||||
curl -L https://github.com/cuelang/cue/releases/download/v0.3.0-beta.5/cue_0.3.0-beta.5_Linux_x86_64.tar.gz | sudo tar zxf - -C /usr/local/bin
|
|
||||||
|
|
||||||
- name: Check out
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
|
curl -L https://github.com/cuelang/cue/releases/download/${CUE_VERSION}/${CUE_TARBALL} | sudo tar zxf - -C /usr/local/bin
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
make
|
make
|
||||||
|
8
Makefile
8
Makefile
@ -19,7 +19,7 @@ cuefmt:
|
|||||||
@(cue fmt -s ./examples/*)
|
@(cue fmt -s ./examples/*)
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: cuefmt check-buildkit-version check-cue-version
|
lint: cuefmt check-buildkit-version
|
||||||
golangci-lint run
|
golangci-lint run
|
||||||
@test -z "$$(git status -s . | grep -e "^ M" | grep .cue | cut -d ' ' -f3 | tee /dev/stderr)"
|
@test -z "$$(git status -s . | grep -e "^ M" | grep .cue | cut -d ' ' -f3 | tee /dev/stderr)"
|
||||||
|
|
||||||
@ -30,12 +30,6 @@ check-buildkit-version:
|
|||||||
"$(shell grep ' = "v' ./pkg/buildkitd/buildkitd.go | sed -E 's/^.*version.*=.*\"(v.*)\"/\1/' )" \
|
"$(shell grep ' = "v' ./pkg/buildkitd/buildkitd.go | sed -E 's/^.*version.*=.*\"(v.*)\"/\1/' )" \
|
||||||
|| { echo buildkit version mismatch go.mod != pkg/buildkitd/buildkitd.go ; exit 1; }
|
|| { echo buildkit version mismatch go.mod != pkg/buildkitd/buildkitd.go ; exit 1; }
|
||||||
|
|
||||||
.PHONY: check-cue-version
|
|
||||||
check-cue-version:
|
|
||||||
@grep -q "$(shell grep cue ./go.mod | cut -d' ' -f2)" .github/workflows/ci.yml \
|
|
||||||
|| { echo cue version mismatch go.mod != .github/workflows/ci.yml ; exit 1; }
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: integration
|
.PHONY: integration
|
||||||
integration: dagger-debug
|
integration: dagger-debug
|
||||||
# Self-diagnostics
|
# Self-diagnostics
|
||||||
|
Reference in New Issue
Block a user