Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
EVEREST-725 dev CI (#258)
Browse files Browse the repository at this point in the history
* Checks & go.mod

* go mod

* verion.go and additional checks

* fix version test

* fix version test

* fix version test

* downgrade upload-artifact

* update operator & BE versions
  • Loading branch information
oksana-grishchenko authored Dec 28, 2023
1 parent 0a185e0 commit c422ac1
Show file tree
Hide file tree
Showing 8 changed files with 593 additions and 39 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,45 @@ jobs:
- name: Install tools
run: make init

- name: Check the latest operator version is used
run: |
go get github.com/percona/everest-operator@main
echo "Checking there is no source code changes"
go mod tidy
git diff --exit-code
- name: Check the latest BE version is used
run: |
go get github.com/percona/percona-everest-backend@main
echo "Checking there is no source code changes"
go mod tidy
git diff --exit-code
- name: Check the Makefile references dev version
run: |
if ! grep -q "RELEASE_VERSION ?= v0.0.0" Makefile; then
echo "default RELEASE_VERSION in Makefile should be 0.0.0"
exit 1
fi
- name: Check the pkg/version/version.go references the dev manifest and catalog
run: |
if ! grep -q 'devCatalogImage = "docker.io/perconalab/everest-catalog:latest"' pkg/version/version.go; then
echo "default CLI release in install.sh should be latest"
exit 1
fi
if ! grep -q 'devManifestURL = "https://raw.githubusercontent.com/percona/percona-everest-backend/main' pkg/version/version.go; then
echo "default BE manifest in install.sh should be taken from main"
exit 1
fi
- name: Check the install.sh references the latest cli release
run: |
if ! grep -q "curl -sL https://github.com/percona/percona-everest-cli/releases/download/latest" install.sh; then
echo "default CLI release in install.sh should be latest"
exit 1
fi
- name: Run linters
uses: reviewdog/action-golangci-lint@v2
with:
Expand Down Expand Up @@ -258,7 +297,7 @@ jobs:
- name: Attach the report
if: ${{ always() && steps.cli-tests.outcome != 'skipped' }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: cli-tests-report
path: cli-tests/test-report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:

- name: Attach the report
if: ${{ always() && steps.cli-tests.outcome != 'skipped' }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: test-delete-cluster-tests-report
path: cli-tests/test-report
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FILES = $(shell find . -type f -name '*.go')

RELEASE_VERSION ?= $(shell git describe --always --dirty | cut -b2-)
RELEASE_VERSION ?= v0.0.0-$(shell git rev-parse --short HEAD)
RELEASE_FULLCOMMIT ?= $(shell git rev-parse HEAD)

LD_FLAGS = -ldflags " \
Expand Down
9 changes: 5 additions & 4 deletions cli-tests/tests/version.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import { test } from '@fixtures';
test.describe('Everest CLI "version" validation', async () => {
test('version validation', async ({ cli }) => {
const out = await cli.everestExecSilent('version');
const version = await cli.exec('git describe --always --dirty|cut -b2-');
await version.assertSuccess();
const hash = await cli.exec('git rev-parse --short HEAD');

await hash.assertSuccess();
const version = `v0.0.0-${hash.getStdOutLines()[0]}`;

await out.assertSuccess();
await out.outContainsNormalizedMany([
'ProjectName: everestctl',
'Version: ' + version.getStdOutLines()[0],
`Version: ${version}`,
]);
});

});
43 changes: 38 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ require (
github.com/hashicorp/go-version v1.6.0
github.com/operator-framework/api v0.20.0
github.com/operator-framework/operator-lifecycle-manager v0.26.0
github.com/percona/everest-operator v0.4.1-0.20231106102613-c61926d6c066
github.com/percona/percona-everest-backend v0.5.0
github.com/percona/everest-operator v0.6.0-dev1.0.20231228161448-9554994bae64
github.com/percona/percona-everest-backend v0.5.1-0.20231228162533-f91a4af5205c
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.1
github.com/stretchr/testify v1.8.4
Expand All @@ -29,58 +29,83 @@ require (
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 // indirect
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/aws/aws-sdk-go v1.49.5 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bshuster-repo/logrus-logstash-hook v1.0.0 // indirect
github.com/cert-manager/cert-manager v1.12.4 // indirect
github.com/creack/pty v1.1.18 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/flosch/pongo2/v6 v6.0.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getkin/kin-openapi v0.120.0 // indirect
github.com/getkin/kin-openapi v0.122.0 // indirect
github.com/go-errors/errors v1.5.0 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/cel-go v0.17.7 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/h2non/filetype v1.1.1 // indirect
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/minio/minio-go v6.0.14+incompatible // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/mongodb/mongo-tools v0.0.0-20230720205640-fb74684da15f // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/montanaflynn/stats v0.6.6 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/onsi/gomega v1.29.0 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/oapi-codegen/runtime v1.1.0 // indirect
github.com/onsi/gomega v1.30.0 // indirect
github.com/operator-framework/operator-registry v1.30.1 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/percona/percona-backup-mongodb v1.8.1-0.20230920143330-3b1c2e263901 // indirect
github.com/percona/percona-postgresql-operator v0.0.0-20230629061704-21f8d7d89b98 // indirect
github.com/percona/percona-server-mongodb-operator v1.15.0 // indirect
github.com/percona/percona-xtradb-cluster-operator v1.13.0 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
Expand All @@ -94,10 +119,17 @@ require (
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
go.mongodb.org/mongo-driver v1.12.1 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.15.0 // indirect
Expand All @@ -118,6 +150,7 @@ require (
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect
sigs.k8s.io/mcs-api v0.1.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit c422ac1

Please sign in to comment.