-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
name: Continuous Integration - GoReleaser | ||
name: Continuous Integration - Test File | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: [".goreleaser.yaml"] | ||
pull_request: | ||
branches: [main] | ||
paths: [".goreleaser.yaml"] | ||
|
||
jobs: | ||
file-changed: | ||
name: Did the file change | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
changed: ${{ steps.file-check.outputs.changed }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- id: file-check | ||
name: Check for the file change | ||
continue-on-error: true | ||
run: | | ||
git diff --quiet main..HEAD -- testfile.txt | ||
echo "::setoutput changed=${?}" | ||
check-goreleaser: | ||
name: Check GoReleaser Configuration | ||
needs: file-changed | ||
name: Check Tested File | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Generate the sources | ||
run: make generate-sources | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: ${{ needs.file-changed.outputs.changed == '1' }} | ||
with: | ||
version: latest | ||
args: --snapshot --rm-dist --timeout 1h | ||
- name: Skip Check | ||
if: ${{ needs.file-changed.outputs.changed == '0' }} | ||
run: echo "Nothing to see here" |