Skip to content

feat(gcp): setup cd #327

feat(gcp): setup cd

feat(gcp): setup cd #327

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
env:
TEST_AIO_SUBSYSTEMS_STORE_CONFIG_POSTGRES_HOST: "localhost"
TEST_AIO_SUBSYSTEMS_STORE_CONFIG_POSTGRES_PORT: "5432"
TEST_AIO_SUBSYSTEMS_STORE_CONFIG_POSTGRES_USERNAME: "username"
TEST_AIO_SUBSYSTEMS_STORE_CONFIG_POSTGRES_PASSWORD: "password"
TEST_AIO_SUBSYSTEMS_STORE_CONFIG_POSTGRES_DATABASE: "resonate_test"
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: ${{ env.TEST_AIO_SUBSYSTEMS_STORE_CONFIG_POSTGRES_USERNAME }}
POSTGRES_PASSWORD: ${{ env.TEST_AIO_SUBSYSTEMS_STORE_CONFIG_POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.TEST_AIO_SUBSYSTEMS_STORE_CONFIG_POSTGRES_DATABASE }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: false
- name: Install and run golangci-lint
uses: golangci/golangci-lint-action@v3 # nosemgrep
with:
version: v1.54
args: --verbose --timeout=3m
- name: Run go test and generate coverage report
run: |
go test -v -coverprofile=coverage.out -coverpkg=./... ./...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3 # nosemgrep
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build resonate
run: go build -o resonate
- name: Upload resonate binary
uses: actions/upload-artifact@v3
with:
name: resonate
path: resonate
test:
runs-on: ubuntu-latest
steps:
- name: Download resonate binary
uses: actions/download-artifact@v3
with:
name: resonate
- name: Run resonate server
run: |
chmod +x resonate
./resonate serve --aio-store-sqlite-path :memory: &
- name: Checkout test harness
uses: actions/checkout@v4
with:
repository: resonatehq/durable-promise-test-harness
- name: Build test harness
run: |
go build -o harness
- name: Run linearizability check
run: |
chmod +x harness
./harness verify -r 1000 -c 10
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: test-harness-results
path: test/results/
semgrep:
name: semgrep
runs-on: ubuntu-20.04
env:
SEMGREP_RULES: "auto semgrep.yml"
container:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v4
- run: semgrep ci
trigger-cd:
needs: [build, test, semgrep]
uses: ./.github/workflows/cd.yaml

Check failure on line 121 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yaml

Invalid workflow file

error parsing called workflow ".github/workflows/ci.yaml" -> "./.github/workflows/cd.yaml" : workflow is not reusable as it is missing a `on.workflow_call` trigger
secrets: inherit