-
Notifications
You must be signed in to change notification settings - Fork 0
Seperate go build from go build-and-test #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5fc0617
0f15206
3a82a52
490677d
b9847c0
99d2729
4bd0351
cff8c08
01224d1
bbf9d05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| name: "Go Build" | ||
| description: "Build go repo" | ||
|
|
||
| inputs: | ||
| FLIPPCIRCLECIPULLER_REPO_TOKEN: | ||
| description: Flipp circleci repo token | ||
| required: true | ||
| BUF_BUILD_USER: | ||
| description: Buf CI user stored as secret | ||
| required: false | ||
| BUF_BUILD_API_TOKEN: | ||
| description: Buf API token stored as secret | ||
| required: false | ||
| SLACK_CHANNEL_ID: | ||
| description: The Slack channel ID(s) to send the data to | ||
| required: false | ||
| SLACK_BOT_TOKEN: | ||
| description: The Slack bot token to pass the data to | ||
| required: false | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Set branch variable | ||
| id: set-branch | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
| branch="${{ github.event.pull_request.head.ref }}" | ||
| else | ||
| branch="${{ github.ref }}" | ||
| branch="${branch#refs/heads/}" | ||
| fi | ||
| echo "branch=${branch}" >> $GITHUB_OUTPUT | ||
| - name: Get short sha | ||
| id: get-short-sha | ||
| run: echo "short_sha=`echo ${GITHUB_SHA::7}`" > $GITHUB_OUTPUT | ||
| shell: bash | ||
| - name: Configure Go environment | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this one need configure and the old build and test action didnt?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I read the diff wrong |
||
| uses: wishabi/github-actions/go/configure@v0 | ||
| with: | ||
| FLIPPCIRCLECIPULLER_REPO_TOKEN: ${{ inputs.FLIPPCIRCLECIPULLER_REPO_TOKEN }} | ||
| BUF_BUILD_USER: ${{ inputs.BUF_BUILD_USER }} | ||
| BUF_BUILD_API_TOKEN: ${{ inputs.BUF_BUILD_API_TOKEN }} | ||
| - name: Setup Go dependencies | ||
| uses: wishabi/github-actions/go/deps@v0 | ||
| env: | ||
| BUF_TOKEN: ${{ inputs.BUF_BUILD_API_TOKEN }} | ||
| with: | ||
| FLIPPCIRCLECIPULLER_REPO_TOKEN: ${{ inputs.FLIPPCIRCLECIPULLER_REPO_TOKEN }} | ||
| - name: Notify slack channel on failure | ||
| if: failure() && inputs.SLACK_CHANNEL_ID != null && github.ref == 'refs/heads/main' | ||
| uses: slackapi/slack-github-action@v1.24.0 | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ inputs.SLACK_BOT_TOKEN }} | ||
| with: | ||
| channel-id: ${{ inputs.SLACK_CHANNEL_ID }} | ||
| payload: | | ||
| { | ||
| "text": "Go Build Failed", | ||
| "blocks": [ | ||
| { | ||
| "type": "header", | ||
| "text": { | ||
| "type": "plain_text", | ||
| "text": "Go Build Failed", | ||
| "emoji": true | ||
| } | ||
| }, | ||
| { | ||
| "type": "divider" | ||
| }, | ||
| { | ||
| "type": "section", | ||
| "text": { | ||
| "type": "mrkdwn", | ||
| "text": "*Repository*\n<https://github.com/${{ github.repository }}|${{ github.repository }}>\n\n*${{ github.event_name == 'pull_request' && 'Pull Request' || 'Branch' }}*\n${{ github.event_name == 'pull_request' && format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) || format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.set-branch.outputs.branch)}}" | ||
| }, | ||
| "accessory": { | ||
| "type": "image", | ||
| "image_url": "https://emoji.slack-edge.com/T02AJQYGN/fail/d35657341d0b7dc4.png", | ||
| "alt_text": "error icon" | ||
| } | ||
| }, | ||
| { | ||
| "type": "divider" | ||
| }, | ||
| { | ||
| "type": "section", | ||
| "fields": [ | ||
| { | ||
| "type": "mrkdwn", | ||
| "text": "*Version/Commit*" | ||
| }, | ||
| { | ||
| "type": "mrkdwn", | ||
| "text": "*Event*" | ||
| }, | ||
| { | ||
| "type": "mrkdwn", | ||
| "text": "${{ steps.get-short-sha.outputs.short_sha }}" | ||
| }, | ||
| { | ||
| "type": "mrkdwn", | ||
| "text": "${{ github.event_name }}" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "context", | ||
| "elements": [ | ||
| { | ||
| "type": "mrkdwn", | ||
| "text": "*Triggered By:* ${{ github.triggering_actor }}" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||

Uh oh!
There was an error while loading. Please reload this page.