Skip to content

ci: Create workflow test-build.yml #2

ci: Create workflow test-build.yml

ci: Create workflow test-build.yml #2

Workflow file for this run

name: Test Build
on:
workflow_dispatch:
pull_request:
jobs:
update-cli-docs:
runs-on: ubuntu-latest
container:
image: techallylw/ally-releases:1.21.0
strategy:
matrix:
go-version: ['1.21.x']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 1
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Run linting tests
id: update
run: |
git config --global --add safe.directory "${{ github.workspace }}"
make prepare
make lint
make fmt-check
make imports-check
- name: Run unit tests
run: |
make coverage-ci
- name: Build cross-platform binaries
run: |
make build-cli-cross-platform
- name: Run integration tests
run: |
sudo apt-get update
sudo apt-get install -y vim
make integration-only
- name: Trigger release
if: github.ref == 'refs/heads/main'
env:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
run: |
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes
scripts/release.sh trigger
- name: Notify Slack on Failure
uses: slackapi/slack-github-action@v1.25.0
if: failure() && github.ref == 'refs/heads/main'
with:
payload: |
{
"attachments": [
{
"color": "#E92020",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*GitHub Workflow Failure*\ngo-sdk/test-build\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}\n@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:"
}
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK