Skip to content

add release action + some more UT coverage #20

add release action + some more UT coverage

add release action + some more UT coverage #20

Workflow file for this run

name: ci
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }}
cancel-in-progress: true
jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Set VERSION env
run: echo "VERSION=$(cat splitio/version.go | grep 'Version =' | awk '{print $3}' | tr -d '"')" >> $GITHUB_ENV
- name: Version validation
if: ${{ github.event_name == 'pull_request' }}
uses: mukunku/tag-exists-action@v1.2.0
id: checkTag
with:
tag: ${{ env.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fail workflow if tag exists
if: ${{ github.event_name == 'pull_request' && steps.checkTag.outputs.exists == 'true' }}
uses: actions/github-script@v6.4.0
with:
script: core.setFailed('[ERROR] Tag already exists.')
- name: Setup Go version
uses: actions/setup-go@v4
with:
go-version: '^1.19.1'
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build binaries for host machine
run: make splitd splitcli
- name: Cross build for GNU Linux & Darwin x amd64 & arm64
run: make binaries_release
- name: Run tests
run: make test
- name: SonarQube Scan
uses: SonarSource/sonarcloud-github-action@v1.9.1
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectVersion=${{ env.VERSION }}
- name: Git tag
if: ${{ github.event_name == 'push' }}
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.VERSION }}
tag_prefix: 'v'
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'push' }}
with:
name: splitd-${{ env.VERSION }}
files:
- splitd-darwin-amd64-${{ env.VERSION }}.bin

Check failure on line 82 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / ci

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 82, Col: 13): A sequence was not expected
- splitd-darwin-arm-${{ env.VERSION }}.bin
- splitd-linux-amd64-${{ env.VERSION }}.bin
- splitd-linux-arm-${{ env.VERSION }}.bin