@@ -902,7 +902,88 @@ jobs:
902
902
- name : Run tests
903
903
working-directory : ./web-app
904
904
run : yarn test --passWithNoTests
905
+ replication :
906
+ name : Site Replication Test
907
+ needs :
908
+ - lint-job
909
+ - ui-assets
910
+ - semgrep-static-code-analysis
911
+ - latest-minio
912
+ runs-on : [ubuntu-latest]
913
+
914
+ strategy :
915
+ matrix :
916
+ go-version : [1.24.x]
917
+
918
+ steps :
919
+ - name : Check out code
920
+ uses : actions/checkout@v3
921
+
922
+ - name : Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
923
+ uses : actions/setup-go@v5
924
+ with :
925
+ go-version : ${{ matrix.go-version }}
926
+ id : go
927
+
928
+ - name : Clone github.com/minio/minio
929
+ uses : actions/checkout@master
930
+ with :
931
+ repository : minio/minio
932
+ path : " minio_repository"
933
+ - name : Check-out matching MinIO branch
934
+ env :
935
+ GH_BRANCH : ${{ github.head_ref || github.ref_name }}
936
+ GH_PR_REPO : ${{ github.event.pull_request.head.repo.full_name }}
937
+ run : |
938
+ GH_PR_ACCOUNT=`echo $GH_PR_REPO | sed "s/\\/.*//"`
939
+ if [ ! -z "$GH_PR_ACCOUNT" ] && [ ! "$GH_PR_ACCOUNT" = "minio" ]; then
940
+ ALTREPO="https://github.com/$GH_PR_ACCOUNT/minio.git"
941
+ echo "Attempting to fetch $ALTREPO..."
942
+ git remote add alt $ALTREPO
943
+ (git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
944
+ fi
945
+ - uses : actions/cache@v4
946
+ id : minio-latest-cache
947
+ name : MinIO Latest Cache
948
+ with :
949
+ path : |
950
+ ./minio
951
+ key : ${{ runner.os }}-minio-latest-${{ hashFiles('./minio_repository/go.sum') }}
905
952
953
+ - name : Build on ${{ matrix.os }}
954
+ run : |
955
+ echo "The idea is to build minio image from downloaded repository";
956
+ cd $GITHUB_WORKSPACE/minio_repository;
957
+ echo "Get git version to build MinIO Image";
958
+ VERSION=`git rev-parse HEAD`;
959
+ echo $VERSION;
960
+ echo "Create MinIO image";
961
+ make docker VERSION=$VERSION;
962
+
963
+ docker build -q --no-cache -t minio/minio:$VERSION . -f Dockerfile
964
+ echo "Jumping back to console repository to run the integration test"
965
+ cd $GITHUB_WORKSPACE;
966
+
967
+ echo "We are going to use the built image on test-integration";
968
+ MINIO_VERSION="minio/minio:$VERSION";
969
+ echo $MINIO_VERSION;
970
+
971
+ make test-replication MINIO_VERSION=$MINIO_VERSION;
972
+ - uses : actions/cache@v4
973
+ id : coverage-cache-replication
974
+ name : Coverage Cache Replication
975
+ with :
976
+ path : |
977
+ ./replication/coverage/
978
+ key : ${{ runner.os }}-replication-coverage-2-${{ github.run_id }}
979
+
980
+ # To save our replication.out file into an artifact.
981
+ # By default, GitHub stores build logs and artifacts for 90 days.
982
+ - uses : actions/upload-artifact@v4
983
+ with :
984
+ name : replication-artifact
985
+ path : ./replication/coverage/replication.out
986
+ if-no-files-found : error
906
987
sso-integration :
907
988
name : SSO Integration Test
908
989
needs :
@@ -995,6 +1076,7 @@ jobs:
995
1076
- test-api-on-go
996
1077
- test-pkg-on-go
997
1078
- sso-integration
1079
+ - replication
998
1080
runs-on : ${{ matrix.os }}
999
1081
strategy :
1000
1082
matrix :
@@ -1030,6 +1112,14 @@ jobs:
1030
1112
./sso-integration/coverage/
1031
1113
key : ${{ runner.os }}-sso-coverage-2-${{ github.run_id }}
1032
1114
1115
+ - uses : actions/cache@v4
1116
+ id : coverage-cache-replication
1117
+ name : Coverage Cache Replication
1118
+ with :
1119
+ path : |
1120
+ ./replication/coverage/
1121
+ key : ${{ runner.os }}-replication-coverage-2-${{ github.run_id }}
1122
+
1033
1123
- uses : actions/cache@v4
1034
1124
id : coverage-cache-api
1035
1125
name : Coverage Cache API
@@ -1046,6 +1136,12 @@ jobs:
1046
1136
./pkg/coverage/
1047
1137
key : ${{ runner.os }}-coverage-pkg-2-${{ github.run_id }}
1048
1138
1139
+ # Get the replication.out file from the artifact since this is working for self host runner.
1140
+ - uses : actions/download-artifact@v4
1141
+ with :
1142
+ name : replication-artifact
1143
+ path : replication/coverage
1144
+
1049
1145
- name : Get coverage
1050
1146
run : |
1051
1147
echo "change directory to gocovmerge"
@@ -1057,7 +1153,7 @@ jobs:
1057
1153
echo "go build gocoverage.go"
1058
1154
go build gocovmerge.go
1059
1155
echo "put together the outs for final coverage resolution"
1060
- ./gocovmerge ../integration/coverage/system.out ../sso-integration/coverage/sso-system.out ../api/coverage/coverage.out ../pkg/coverage/coverage-pkg.out > all.out
1156
+ ./gocovmerge ../integration/coverage/system.out ../replication/coverage/replication.out ../ sso-integration/coverage/sso-system.out ../api/coverage/coverage.out ../pkg/coverage/coverage-pkg.out > all.out
1061
1157
echo "grep to obtain the result"
1062
1158
go tool cover -func=all.out | grep total > tmp2
1063
1159
result=`cat tmp2 | awk 'END {print $3}'`
0 commit comments