Skip to content

Commit

Permalink
Test the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hdost committed Dec 20, 2021
1 parent 16a4b9a commit 3315b99
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/ci-goreleaser.yaml
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"

0 comments on commit 3315b99

Please sign in to comment.