-
Notifications
You must be signed in to change notification settings - Fork 101
115 lines (105 loc) · 3.17 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
on:
push:
branches:
- main
pull_request:
types: [ assigned, opened, synchronize, reopened ]
release:
types: [ prereleased, released ]
name: Main
jobs:
Pr:
if: github.event_name == 'pull_request'
uses: formancehq/gh-workflows/.github/workflows/pr-style.yml@main
Test_postgres:
name: 'Test with PostgreSQL'
runs-on: ubuntu-latest
steps:
- name: Install task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- name: Run tests
run: task tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
Test_sqlite:
uses: formancehq/gh-workflows/.github/workflows/golang-test.yml@main
Control:
name: 'Control'
uses: ./.github/workflows/template_build-control.yaml
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
GoReleaserBuild:
needs:
- Control
- Test_sqlite
- Test_postgres
if: github.event_name != 'release'
name: 'GoReleaser Build'
uses: ./.github/workflows/template_goreleaser-build.yaml
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SEGMENT_WRITE_KEY_OSS: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}
GoReleaserRelease:
needs:
- Control
- Test_sqlite
- Test_postgres
if: github.event_name == 'release'
name: 'GoReleaser Release'
uses: ./.github/workflows/template_goreleaser-release.yaml
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SEGMENT_WRITE_KEY_OSS: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
SdkGenerate:
needs:
- GoReleaserBuild
uses: ./.github/workflows/template_sdk-generate.yaml
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SdkPublish:
needs:
- GoReleaserRelease
uses: ./.github/workflows/template_sdk-publish.yaml
with:
VERSION: ${{ github.event.release.tag_name }}
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
DockerRelease:
needs:
- Control
- Test_sqlite
- Test_postgres
if: github.event_name == 'release'
uses: ./.github/workflows/template_docker.yaml
with:
VERSION: ${{ github.event.release.tag_name }}
APP_SHA: ${{ github.sha }}
RELEASE: ${{ github.event.action }}
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SEGMENT_WRITE_KEY_OSS: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}
DockerBranch:
needs:
- Control
- Test_sqlite
- Test_postgres
if: github.event_name != 'release'
uses: ./.github/workflows/template_docker.yaml
with:
VERSION: develop
APP_SHA: ${{ github.sha }}
RELEASE: ${{ github.event.action }}
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SEGMENT_WRITE_KEY_OSS: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}