github.com/seachicken/gh-poi@v0.9.10/.github/workflows/ci.yml (about) 1 name: CI 2 3 on: 4 push: 5 branches: 6 - '*' 7 tags: 8 - '' 9 10 jobs: 11 12 build: 13 strategy: 14 fail-fast: false 15 matrix: 16 os: [ubuntu-latest, macos-latest] 17 runs-on: ${{ matrix.os }} 18 19 steps: 20 - uses: actions/checkout@v4 21 22 - name: Set up Go 23 uses: actions/setup-go@v5 24 with: 25 go-version-file: 'go.mod' 26 27 - name: Build 28 run: go build -v ./... 29 30 - name: Checkout dummy repo 31 uses: actions/checkout@v4 32 with: 33 repository: seachicken/can 34 path: ci-test 35 fetch-depth: 0 36 37 - name: Test 38 working-directory: ./ci-test 39 run: | 40 for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match 'main$') 41 do 42 git branch --track "${branch##*/}" "$branch" 43 done 44 echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token 45 go test $(go list ../... | grep -v /conn) -v -race -coverprofile=coverage.out -covermode=atomic 46 47 - name: Upload coverage to Codecov 48 uses: codecov/codecov-action@v4 49 with: 50 directory: ./ci-test/ 51 token: ${{ secrets.CODECOV_TOKEN }}