ci: ensure cue version is consistent

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-03-02 18:59:07 -08:00
parent 8e9a432caf
commit 14f535655d
2 changed files with 9 additions and 2 deletions

View File

@ -22,7 +22,7 @@ jobs:
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
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.4/cue_0.3.0-beta.4_Linux_x86_64.tar.gz | sudo tar zxf - -C /usr/local/bin 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 - name: Check out
uses: actions/checkout@v2 uses: actions/checkout@v2

View File

@ -19,7 +19,7 @@ cuefmt:
@(cue fmt -s ./examples/*) @(cue fmt -s ./examples/*)
.PHONY: lint .PHONY: lint
lint: cuefmt check-buildkit-version lint: cuefmt check-buildkit-version check-cue-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,9 +30,16 @@ 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
./tests/test-test.sh 2>/dev/null ./tests/test-test.sh 2>/dev/null
# Actual integration tests # Actual integration tests
DAGGER_BINARY="./cmd/dagger/dagger-debug" time ./tests/test.sh all DAGGER_BINARY="./cmd/dagger/dagger-debug" time ./tests/test.sh all