diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6abf6df98..fded7ab07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,29 +6,98 @@ on: - '**' jobs: - free-disk-space: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-22.04 steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - tool-cache: true - - lint_test: - needs: free-disk-space - uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.2.1 - secrets: inherit - with: - run-unit-tests: true - run-integration-tests: true - run-lint: true - integration-tests-command: | - sudo make test-e2e - - # docker_pipeline: - # uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.2.1 - # secrets: inherit - # with: - # publish: false - # dockerfile: ./contrib/images/babylond/Dockerfile - # repoName: babylond \ No newline at end of file + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + + - name: Print Go environment + run: go env + + - name: Build Application + run: make build + +# needs: build, in other jobs is to utilize the go cache created by build + lint: + needs: build + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + + - name: Run Lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.59 + args: --timeout=10m + + unit-tests: + needs: build + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + + - name: Run Unit Tests + run: | + make test + + check-mock-gen: + needs: build + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + + - name: Run make mock-gen + run: make mocks + + - name: Check for uncommitted changes + run: | + if ! git diff --exit-code; then + echo "Uncommitted changes detected. Please run 'make mocks' before committing." + exit 1 + fi + + build-integration-tests: + needs: build + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build E2E Dockers + run: | + sudo make build-docker-e2e + + run-integration-tests: + needs: build-integration-tests + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run E2E Tests + run: | + sudo make test-e2e-cache \ No newline at end of file diff --git a/Makefile b/Makefile index eed445275..a0c5a9745 100644 --- a/Makefile +++ b/Makefile @@ -254,8 +254,10 @@ endif .PHONY: run-tests test test-all $(TEST_TARGETS) -test-e2e: build-docker-e2e - go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 --tags=e2e +test-e2e: build-docker-e2e test-e2e-cache + +test-e2e-cache: + go test -mod=readonly -timeout=60m -v $(PACKAGES_E2E) -count=1 --tags=e2e test-sim-nondeterminism: @echo "Running non-determinism test..." diff --git a/contrib/images/Makefile b/contrib/images/Makefile index 45f6c057c..5c9892904 100644 --- a/contrib/images/Makefile +++ b/contrib/images/Makefile @@ -4,16 +4,16 @@ BABYLON_VERSION_BEFORE_UPGRADE ?= v0.9.0 all: babylond cosmos-relayer -babylond: babylond-rmi +babylond: docker build --tag babylonlabs-io/babylond -f babylond/Dockerfile ${BABYLON_FULL_PATH} -babylond-e2e: babylond-rmi +babylond-e2e: docker build --tag babylonlabs-io/babylond -f babylond/Dockerfile ${BABYLON_FULL_PATH} \ - --build-arg BUILD_TAGS="e2e" --progress=plain + --build-arg BUILD_TAGS="e2e" ## TODO: once release docker public versions for tags, remove this! babylond-before-upgrade: - docker build --tag babylonlabs-io/babylond-before-upgrade -f babylond/Dockerfile --progress=plain \ + docker build --tag babylonlabs-io/babylond-before-upgrade -f babylond/Dockerfile \ --build-arg VERSION="${BABYLON_VERSION_BEFORE_UPGRADE}" ${BABYLON_FULL_PATH} babylond-rmi: