mirror of
				https://github.com/0glabs/0g-chain.git
				synced 2025-11-04 11:27:27 +00:00 
			
		
		
		
	Merge pull request #261 from Kava-Labs/kd-ci-tags
Fix issue with tags in circleci
This commit is contained in:
		
						commit
						ad86cf6c20
					
				@ -56,6 +56,43 @@ jobs:
 | 
				
			|||||||
          key: go-src-v1-{{ .Revision }}
 | 
					          key: go-src-v1-{{ .Revision }}
 | 
				
			||||||
          paths:
 | 
					          paths:
 | 
				
			||||||
            - ".git"
 | 
					            - ".git"
 | 
				
			||||||
 | 
					  setup-dependencies-tags:
 | 
				
			||||||
 | 
					    executor: golang
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - checkout
 | 
				
			||||||
 | 
					      - run:
 | 
				
			||||||
 | 
					          name: Checkout with tags
 | 
				
			||||||
 | 
					          command: |
 | 
				
			||||||
 | 
					            git fetch --force origin "refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}"
 | 
				
			||||||
 | 
					            if [ -n "$CIRCLE_BRANCH" ]
 | 
				
			||||||
 | 
					            then
 | 
				
			||||||
 | 
					            git reset --hard $CIRCLE_SHA1
 | 
				
			||||||
 | 
					            git checkout -q -B $CIRCLE_BRANCH
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					            git reset --hard $CIRCLE_SHA1
 | 
				
			||||||
 | 
					      - restore_cache:
 | 
				
			||||||
 | 
					          name: "Restore go modules cache"
 | 
				
			||||||
 | 
					          keys:
 | 
				
			||||||
 | 
					            - go-mod-v2-{{ checksum "go.sum" }}
 | 
				
			||||||
 | 
					      - run:
 | 
				
			||||||
 | 
					          name: Cache go modules
 | 
				
			||||||
 | 
					          command: make go-mod-cache
 | 
				
			||||||
 | 
					      - run:
 | 
				
			||||||
 | 
					          name: Build
 | 
				
			||||||
 | 
					          command: make build
 | 
				
			||||||
 | 
					      - run:
 | 
				
			||||||
 | 
					          name: Git garbage collection
 | 
				
			||||||
 | 
					          command: git gc
 | 
				
			||||||
 | 
					      - save_cache:
 | 
				
			||||||
 | 
					          name: "Save go modules cache"
 | 
				
			||||||
 | 
					          key: go-mod-v2-{{ checksum "go.sum" }}
 | 
				
			||||||
 | 
					          paths:
 | 
				
			||||||
 | 
					            - "/go/pkg/mod"
 | 
				
			||||||
 | 
					      - save_cache:
 | 
				
			||||||
 | 
					          name: "Save source code cache"
 | 
				
			||||||
 | 
					          key: go-src-v1-{{ .Revision }}
 | 
				
			||||||
 | 
					          paths:
 | 
				
			||||||
 | 
					            - ".git"
 | 
				
			||||||
  test-cover:
 | 
					  test-cover:
 | 
				
			||||||
    executor: golang
 | 
					    executor: golang
 | 
				
			||||||
    parallelism: 4
 | 
					    parallelism: 4
 | 
				
			||||||
@ -109,6 +146,14 @@ workflows:
 | 
				
			|||||||
      - test-cover:
 | 
					      - test-cover:
 | 
				
			||||||
          requires:
 | 
					          requires:
 | 
				
			||||||
            - setup-dependencies
 | 
					            - setup-dependencies
 | 
				
			||||||
 | 
					      - setup-dependencies-tags:
 | 
				
			||||||
 | 
					          # This filter enables the job for tags
 | 
				
			||||||
 | 
					          filters:
 | 
				
			||||||
 | 
					            branches:
 | 
				
			||||||
 | 
					              ignore: /.*/
 | 
				
			||||||
 | 
					            tags:
 | 
				
			||||||
 | 
					              only:
 | 
				
			||||||
 | 
					                - /^v.*/
 | 
				
			||||||
      - test-all:
 | 
					      - test-all:
 | 
				
			||||||
          requires:
 | 
					          requires:
 | 
				
			||||||
            - setup-dependencies
 | 
					            - setup-dependencies
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user