| 1 | name: build |
| 2 | on: [push, pull_request] |
| 3 | jobs: |
| 4 | test: |
| 5 | strategy: |
| 6 | matrix: |
| 7 | go-version: [oldstable, stable] |
| 8 | os: [ubuntu-latest, macos-latest, windows-latest] |
| 9 | runs-on: ${{ matrix.os }} |
| 10 | env: |
| 11 | GO111MODULE: "on" |
| 12 | steps: |
| 13 | - uses: actions/checkout@v5 |
| 14 | - uses: actions/setup-go@v6 |
| 15 | with: |
| 16 | go-version: ${{ matrix.go-version }} |
| 17 | cache: true |
| 18 | - run: go mod download |
| 19 | - run: go build -v ./... |
| 20 | - run: go test -v -race ./... |
| 21 | spinner: |
| 22 | strategy: |
| 23 | matrix: |
| 24 | go-version: [oldstable, stable] |
| 25 | os: [ubuntu-latest, macos-latest, windows-latest] |
| 26 | runs-on: ${{ matrix.os }} |
| 27 | env: |
| 28 | GO111MODULE: "on" |
| 29 | steps: |
| 30 | - uses: actions/checkout@v5 |
| 31 | - uses: actions/setup-go@v6 |
| 32 | with: |
| 33 | go-version: ${{ matrix.go-version }} |
| 34 | cache: true |
| 35 | - run: go mod download |
| 36 | working-directory: ./spinner |
| 37 | - run: go build -v ./... |
| 38 | working-directory: ./spinner |
| 39 | - run: go test -v -race ./... |
| 40 | working-directory: ./spinner |
| 41 | examples: |
| 42 | strategy: |
| 43 | matrix: |
| 44 | go-version: [oldstable, stable] |
| 45 | os: [ubuntu-latest, macos-latest, windows-latest] |
| 46 | runs-on: ${{ matrix.os }} |
| 47 | env: |
| 48 | GO111MODULE: "on" |
| 49 | steps: |
| 50 | - uses: actions/checkout@v5 |
| 51 | - uses: actions/setup-go@v6 |
| 52 | with: |
| 53 | go-version: ${{ matrix.go-version }} |
| 54 | cache: true |
| 55 | - run: go mod download |
| 56 | working-directory: ./examples |
| 57 | - run: go build -v ./... |
| 58 | working-directory: ./examples |
| 59 | - run: go test -v -race ./... |
| 60 | working-directory: ./examples |
| 61 | dependabot: |
| 62 | needs: [test, examples, spinner] |
| 63 | runs-on: ubuntu-latest |
| 64 | permissions: |
| 65 | pull-requests: write |
| 66 | contents: write |
| 67 | if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} |
| 68 | steps: |
| 69 | - id: metadata |
| 70 | uses: dependabot/fetch-metadata@v2 |
| 71 | with: |
| 72 | github-token: "${{ secrets.GITHUB_TOKEN }}" |
| 73 | - run: | |
| 74 | gh pr review --approve "$PR_URL" |
| 75 | gh pr merge --squash --auto "$PR_URL" |
| 76 | env: |
| 77 | PR_URL: ${{github.event.pull_request.html_url}} |
| 78 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |