@@ -724,42 +724,93 @@ jobs:
724724 - 7.6.8
725725 - 7.2.9
726726 steps :
727- - name : Install cbdinocluster
728- run : |
729- mkdir -p "$HOME/bin"
730- curl -L -o "$HOME/bin/cbdinocluster" https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.98/cbdinocluster-linux-amd64
731- chmod a+x "$HOME/bin/cbdinocluster"
732- echo "$HOME/bin" >> $GITHUB_PATH
733- - name : Initialize cbdinocluster
727+ - uses : actions/checkout@v4
728+ - name : Create Couchbase cluster
729+ id : create-cluster
730+ uses : ./.github/actions/create-cluster
731+ with :
732+ version : ${{ matrix.server }}
733+ - uses : actions/download-artifact@v4
734+ with :
735+ name : couchbase-${{ needs.source.outputs.gem_version }}-x86_64-linux
736+ - uses : actions/download-artifact@v4
737+ with :
738+ name : couchbase-opentelemetry-${{ needs.source.outputs.otel_gem_version }}
739+ - uses : actions/download-artifact@v4
740+ with :
741+ name : scripts-${{ needs.source.outputs.gem_version }}
742+ - uses : actions/download-artifact@v4
743+ with :
744+ name : tests-${{ needs.source.outputs.gem_version }}
745+ - uses : ruby/setup-ruby@v1
746+ with :
747+ ruby-version : 3.3
748+ - name : Install
734749 run : |
735- cbdinocluster -v init --auto
736- - name : Start couchbase cluster
750+ COUCHBASE_GEM_PATH=$(realpath couchbase-${{ needs.source.outputs.gem_version }}-*.gem)
751+ COUCHBASE_OPENTELEMETRY_GEM_PATH=$(realpath couchbase-opentelemetry-${{ needs.source.outputs.otel_gem_version }}.gem)
752+ mkdir -p local-gem-repo/gems
753+ mv ${COUCHBASE_GEM_PATH} local-gem-repo/gems
754+ mv ${COUCHBASE_OPENTELEMETRY_GEM_PATH} local-gem-repo/gems
755+ GEM_REPO_PATH=$(realpath local-gem-repo)
756+ gem generate_index --directory local-gem-repo
757+ ruby -i.bak -pe "gsub(/gemspec$/, 'gem \"couchbase\", source: \"file://${GEM_REPO_PATH}\"')" Gemfile
758+ ruby -i.bak -pe "gsub(/gemspec path: \"couchbase-opentelemetry\"$/, 'gem \"couchbase-opentelemetry\", source: \"file://${GEM_REPO_PATH}\"')" Gemfile
759+ bundle install
760+ bundle exec ruby -r bundler/setup -r couchbase -r couchbase/opentelemetry -e 'pp Couchbase::VERSION, Couchbase::BUILD_INFO, {otel: Couchbase::OpenTelemetry::VERSION}'
761+ - name : Test
737762 env :
738- CLUSTERCONFIG : |
739- nodes:
740- - count: 2
741- version: ${{ matrix.server }}
742- services:
743- - kv
744- - n1ql
745- - index
746- - count: 1
747- version: ${{ matrix.server }}
748- services:
749- - kv
750- - fts
751- - cbas
752- docker:
753- kv-memory: 1500
754- fts-memory: 2048
755- expiry: 1h
763+ TEST_CONNECTION_STRING : ${{ steps.create-cluster.outputs.connstr }}?dump_configuration=true
764+ TEST_SERVER_VERSION : ${{ matrix.server }}
756765 run : |
757- CLUSTER_ID=$(cbdinocluster -v allocate --def="${CLUSTERCONFIG}")
758- CONNECTION_STRING=$(cbdinocluster -v connstr "${CLUSTER_ID}")
759- cbdinocluster -v buckets add ${CLUSTER_ID} default --ram-quota-mb=100 --flush-enabled=true
760- cbdinocluster -v buckets load-sample ${CLUSTER_ID} travel-sample
761- echo "CLUSTER_ID=${CLUSTER_ID}" >> "$GITHUB_ENV"
762- echo "TEST_CONNECTION_STRING=${CONNECTION_STRING}?dump_configuration=true" >> "$GITHUB_ENV"
766+ bundle exec rake test
767+ - name : Publish Test Report
768+ uses : mikepenz/action-junit-report@v4.1.0
769+ if : always()
770+ with :
771+ check_name : 🐧server, ee-${{ matrix.server }}
772+ report_paths : test/reports/*.xml
773+ require_tests : true
774+ annotate_only : true
775+ - name : Collect server logs
776+ timeout-minutes : 15
777+ if : failure()
778+ run : |
779+ mkdir -p logs
780+ cbdinocluster -v collect-logs ${{ steps.create-cluster.outputs.id }} ./logs
781+ - name : Upload logs
782+ if : failure()
783+ uses : actions/upload-artifact@v4
784+ with :
785+ name : ${{ github.job }}-${{ github.run_attempt }}-${{ matrix.server }}-logs
786+ path : |
787+ logs/*
788+ test/**/*.{log,xml}
789+ retention-days : 5
790+
791+ test_cng_linux_x86_64 :
792+ timeout-minutes : 60
793+ needs :
794+ - source
795+ - repackage_linux_x86_64
796+ runs-on : ubuntu-22.04
797+ strategy :
798+ fail-fast : false
799+ matrix :
800+ server :
801+ - 8.0.0
802+ steps :
803+ - uses : actions/checkout@v4
804+ - name : Create Couchbase cluster
805+ id : create-cluster
806+ uses : ./.github/actions/create-cluster
807+ with :
808+ version : ${{ matrix.server }}
809+ - name : Start CNG
810+ id : start-cng
811+ uses : ./.github/actions/start-cng
812+ with :
813+ couchbase-hostname : ${{ steps.create-cluster.outputs.ip }}
763814 - uses : actions/download-artifact@v4
764815 with :
765816 name : couchbase-${{ needs.source.outputs.gem_version }}-x86_64-linux
@@ -790,14 +841,15 @@ jobs:
790841 bundle exec ruby -r bundler/setup -r couchbase -r couchbase/opentelemetry -e 'pp Couchbase::VERSION, Couchbase::BUILD_INFO, {otel: Couchbase::OpenTelemetry::VERSION}'
791842 - name : Test
792843 env :
844+ TEST_CONNECTION_STRING : ${{ steps.start-cng.outputs.cng-connection-string }}?trust_certificate=${{ steps.start-cng.outputs.ca-cert-path }}
793845 TEST_SERVER_VERSION : ${{ matrix.server }}
794846 run : |
795847 bundle exec rake test
796848 - name : Publish Test Report
797849 uses : mikepenz/action-junit-report@v4.1.0
798850 if : always()
799851 with :
800- check_name : 🐧server , ee-${{ matrix.server }}
852+ check_name : 🐧cng , ee-${{ matrix.server }}
801853 report_paths : test/reports/*.xml
802854 require_tests : true
803855 annotate_only : true
@@ -806,7 +858,7 @@ jobs:
806858 if : failure()
807859 run : |
808860 mkdir -p logs
809- cbdinocluster -v collect-logs $CLUSTER_ID ./logs
861+ cbdinocluster -v collect-logs ${{ steps.create-cluster.outputs.id }} ./logs
810862 - name : Upload logs
811863 if : failure()
812864 uses : actions/upload-artifact@v4
0 commit comments