Skip to content

update each ci workflow to call its corresponding release workflow #95

update each ci workflow to call its corresponding release workflow

update each ci workflow to call its corresponding release workflow #95

name: '[Go] SecureMemory CI'
on:
workflow_dispatch:
inputs:
go-version:
description: 'Go version'
required: false
push:
paths:
- 'go/securememory/**'
- '.github/workflows/go-securememory-*'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-go-sm-${{ github.ref }}
cancel-in-progress: true
jobs:
init-defaults:
name: Init Defaults
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.init.outputs.go-version }}
steps:
- id: init
name: Init Go version
run: |
go_version="${{ inputs.go-version }}"
if [ -z "${go_version}" ]; then
go_version='stable'
fi
echo "Go version: ${go_version}"
echo "go-version=${go_version}" >> $GITHUB_OUTPUT
build:
name: Build
runs-on: ubuntu-latest
needs: init-defaults
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: ${{ needs.init-defaults.outputs.go-version }}
cache-dependency-path: 'go/*/go.sum'
- name: Install dependencies
run: |
cd go/securememory
go get .
- name: Build
run: |
cd go/securememory
./scripts/build.sh
test:
name: Run Unit Tests
runs-on: ubuntu-latest
needs: [build, init-defaults]
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: ${{ needs.init-defaults.outputs.go-version }}
cache-dependency-path: 'go/*/go.sum'
- name: Install dependencies
run: |
cd go/securememory
go get .
go install gotest.tools/gotestsum@latest
- name: Run linters
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 # v6.3.2
with:
version: 'v1.64.2'
working-directory: 'go/securememory'
- name: Run unit tests
run: |
cd go/securememory
sudo prlimit --pid $$ --core=-1
sudo prlimit --pid $$ --memlock=-1:-1
./scripts/test.sh
- name: Unit test summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.3.0
with:
paths: 'go/securememory/junit_results.xml'
if: always()
release:

Check failure on line 103 in .github/workflows/go-securememory-ci.yml

View workflow run for this annotation

GitHub Actions / [Go] SecureMemory CI

Invalid workflow file

The workflow is not valid. .github/workflows/go-securememory-ci.yml (Line: 103, Col: 3): Error calling workflow 'godaddy/asherah/.github/workflows/go-securememory-release.yml@9d4b170241930cf9b1769dd15cf1c75b4806d9ec'. The workflow is requesting 'contents: write', but is only allowed 'contents: read'.
if: startsWith(github.ref, 'refs/heads/release-')
needs: test
name: Release
uses: ./.github/workflows/go-securememory-release.yml