|
1 | 1 | name: build
|
2 | 2 |
|
| 3 | +concurrency: |
| 4 | + group: ${{ github.head_ref || github.ref_name }} |
| 5 | + cancel-in-progress: true |
| 6 | + |
3 | 7 | on:
|
4 | 8 | push:
|
5 | 9 | tags:
|
|
11 | 15 | - "**/*.go"
|
12 | 16 | - "Taskfile.yml"
|
13 | 17 | - "Dockerfile"
|
14 |
| - - ".github/workflows/build.yml" |
| 18 | + - ".github/workflows/*.yml" |
15 | 19 | - "testdata/**"
|
16 | 20 | - ".goreleaser.yml"
|
17 | 21 | pull_request:
|
|
20 | 24 | - "**/*.go"
|
21 | 25 | - "Taskfile.yml"
|
22 | 26 | - "Dockerfile"
|
23 |
| - - ".github/workflows/build.yml" |
| 27 | + - ".github/workflows/*.yml" |
24 | 28 | - "testdata/**"
|
25 | 29 | - ".goreleaser.yml"
|
26 | 30 |
|
|
42 | 46 | unit-tests:
|
43 | 47 | strategy:
|
44 | 48 | matrix:
|
45 |
| - os: [ubuntu-latest, macos-latest] |
| 49 | + os: [ubuntu-latest, macos-latest, windows-latest] |
46 | 50 | runs-on: ${{ matrix.os }}
|
47 | 51 | steps:
|
48 | 52 | - uses: actions/checkout@v4
|
|
52 | 56 | - uses: arduino/setup-task@v2
|
53 | 57 | with:
|
54 | 58 | repo-token: ${{ secrets.GITHUB_TOKEN }}
|
55 |
| - - name: setup-tparse |
56 |
| - run: go install github.com/mfridman/tparse@latest |
57 | 59 | - run: task setup
|
58 |
| - - name: test |
59 |
| - run: ./scripts/test.sh test ${{ matrix.os }} |
| 60 | + - run: task test |
60 | 61 | - uses: codecov/codecov-action@v4
|
61 | 62 | if: matrix.os == 'ubuntu-latest'
|
62 | 63 | with:
|
|
82 | 83 | - uses: docker/setup-qemu-action@v3
|
83 | 84 | - uses: docker/setup-buildx-action@v3
|
84 | 85 | - run: task setup
|
85 |
| - - name: setup-tparse |
86 |
| - run: go install github.com/mfridman/tparse@latest |
87 |
| - - name: acceptance |
88 |
| - run: ./scripts/test.sh acceptance ubuntu-latest |
| 86 | + - run: task acceptance |
89 | 87 | env:
|
90 | 88 | TEST_PATTERN: "/${{ matrix.pkgFormat }}/${{ matrix.pkgPlatform }}/"
|
| 89 | + windows-build-pkgs: |
| 90 | + needs: [unit-tests] |
| 91 | + runs-on: windows-latest |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v4 |
| 94 | + - uses: actions/setup-go@v5 |
| 95 | + with: |
| 96 | + go-version: stable |
| 97 | + - uses: arduino/setup-task@v2 |
| 98 | + with: |
| 99 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 100 | + - shell: bash |
| 101 | + run: | |
| 102 | + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 103 | + - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 |
| 104 | + with: |
| 105 | + path: dist/ |
| 106 | + key: ${{ env.sha_short }} |
| 107 | + enableCrossOsArchive: true |
| 108 | + - run: task acceptance:windows:package |
| 109 | + install-windows-pkgs: |
| 110 | + runs-on: ubuntu-latest |
| 111 | + needs: [windows-build-pkgs] |
| 112 | + steps: |
| 113 | + - uses: docker/setup-qemu-action@v3 |
| 114 | + - uses: actions/checkout@v4 |
| 115 | + - uses: arduino/setup-task@v2 |
| 116 | + with: |
| 117 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 118 | + - shell: bash |
| 119 | + run: | |
| 120 | + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 121 | + - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 |
| 122 | + with: |
| 123 | + path: dist/ |
| 124 | + key: ${{ env.sha_short }} |
| 125 | + enableCrossOsArchive: true |
| 126 | + - run: task acceptance:windows:install |
| 127 | + dependabot: |
| 128 | + needs: [unit-tests, acceptance-tests, install-windows-pkgs] |
| 129 | + runs-on: ubuntu-latest |
| 130 | + permissions: |
| 131 | + pull-requests: write |
| 132 | + contents: write |
| 133 | + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} |
| 134 | + steps: |
| 135 | + - id: metadata |
| 136 | + uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 # v2.2.0 |
| 137 | + with: |
| 138 | + github-token: "${{ secrets.GITHUB_TOKEN }}" |
| 139 | + - run: | |
| 140 | + gh pr review --approve "$PR_URL" |
| 141 | + gh pr merge --squash --auto "$PR_URL" |
| 142 | + env: |
| 143 | + PR_URL: ${{github.event.pull_request.html_url}} |
| 144 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
0 commit comments