.github: Bump actions/setup-go from 3 to 5 #664
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
on: [push, pull_request] | |
name: Test | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.18.x] | |
os: [ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
env: | |
GOPRIVATE: namespacelabs.dev/* | |
NSL_GH_SERVICE: ${{ secrets.NSL_GH_SERVICE }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
path: main | |
- name: Setup cross-invocation caching | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Configure Git | |
run: git config --global url.https://x-access-token:[email protected]/.insteadOf https://github.com/ | |
- name: Test | |
run: cd ./main && go test ./... | |
- uses: ruby/[email protected] | |
with: | |
payload: | | |
{ | |
"attachments": [{ | |
"title": "${{ job.status }}: ${{ github.workflow }}", | |
"title_link": "https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks", | |
"text": "${{ github.repository }}@${{ github.ref }}: <https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>", | |
"fields": [{ "value": ${{ toJson(github.event.head_commit.message) }}, "short": false }], | |
"footer": "${{ github.event.head_commit.committer.name }} at ${{ github.event.head_commit.timestamp }}", | |
"color": "danger" | |
}] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: failure() && github.ref_name == 'main' |