Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: run pipelines in order #1130

Merged
merged 6 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Github Workflows

The execution order of the workflows is as follows:

1. [Linting](golangci-lint.yml)
2. Main pipeline, will run in parallel:
- [Regular pipeline](ci.yml)
- [Reaper Off pipeline](ci-reaper-off.yml)
3. [Modules generator pipeline](ci-modulegen.yml)
4. Modules pipeline, will run in parallel:
- All modules' pipelines
- All examples' pipelines

_MermaidJS diagram created with https://mermaid.live._

```mermaid
flowchart TD
A[golangci-lint] -->|Reaper-on| B(Main Pipeline)
A[golangci-lint] -->|Reaper-off| B(Main Pipeline)
B -->|Module Generator| C[Module generator]
C -->|Modules| D[All modules]
C -->|Examples| E[All examples]
```
59 changes: 59 additions & 0 deletions .github/workflows/ci-modulegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Module generator pipeline

on:
workflow_run:
workflows: [golangci-lint / static-analysis]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
- 'docs/**'
- 'README.md'
pull_request:
paths-ignore:
- 'mkdocs.yml'
- 'docs/**'
- 'README.md'

concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.sha }}"
cancel-in-progress: true

jobs:
test:
strategy:
matrix:
go-version: [1.19.x, 1.x]
platform: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
env:
TESTCONTAINERS_RYUK_DISABLED: "false"
steps:

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: modVerify
working-directory: ./modulegen
run: go mod verify

- name: ensure compilation
working-directory: ./modulegen
run: go build

- name: Run module generator tests
working-directory: ./modulegen
run: make test-unit

- name: Test Summary
uses: test-summary/action@4ee9ece4bca777a38f05c8fc578ac2007fe266f7
with:
paths: "**/TEST-*.xml"
if: always()
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Main pipeline

on:
workflow_run:
workflows: [golangci-lint / static-analysis]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down Expand Up @@ -55,10 +59,6 @@ jobs:
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: make test-unit

- name: Run module generator tests
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: make -C modulegen test-unit

- name: Run checker
run: |
./scripts/check_environment.sh
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cockroachdb-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Cockroachdb example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/consul-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Consul example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/datastore-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Datastore example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/firestore-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Firestore example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Compose module pipeline

on:
workflow_run:
workflows: [Main pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-couchbase.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Couchbase module pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-localstack.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: LocalStack module pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-mysql.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: MySQL module pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-neo4j.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Neo4j module pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-postgres.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Postgres module pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-pulsar.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Pulsar module pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-redis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Redis module pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/module-vault.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: vault module pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/mongodb-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: MongoDB example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/nginx-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Nginx example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pubsub-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Pubsub example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/spanner-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Spanner example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/toxiproxy-example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Toxiproxy example pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
4 changes: 4 additions & 0 deletions modulegen/_template/ci.yml.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{ $lower := ToLower }}name: {{ Title }} {{ ExampleType }} pipeline

on:
workflow_run:
workflows: [Module generator pipeline]
types:
- completed
push:
paths-ignore:
- 'mkdocs.yml'
Expand Down
Loading