-
Notifications
You must be signed in to change notification settings - Fork 35
64 lines (54 loc) · 1.48 KB
/
auto-main-ci.yaml
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
name: Auto Main CI
on:
push:
branches:
- main
env:
ENVIRONMENT_RUNS_ON: self-hosted
ENVIRONMENT_CD: dev
jobs:
unit-test:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: 1.20.4
- name: unit test
run: |
make test > coverage.temp
grep total coverage.temp > covarage.txt
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov
call-images-build:
uses: ./.github/workflows/call-build-imgs.yaml
secrets: inherit
needs: unit-test
with:
CI_TYPE: main
get-environment:
runs-on: ubuntu-latest
needs: call-images-build
outputs:
environment_runs_on: ${{ steps.get_variables.outputs.environment_runs_on }}
enviroment_cd: ${{ steps.get_variables.outputs.enviroment_cd }}
steps:
- name: Get environment variable
id: get_variables
run: |
echo environment_runs_on=${{ env.ENVIRONMENT_RUNS_ON }} >> $GITHUB_OUTPUT
echo enviroment_cd=${{ env.ENVIRONMENT_CD }} >> $GITHUB_OUTPUT
call-cd:
uses: ./.github/workflows/call-cd.yaml
secrets: inherit
needs: get-environment
with:
ENVIRONMENT_RUNS_ON: ${{ needs.get-environment.outputs.environment_runs_on }}
ENRIRONMENT_CD: ${{ needs.get-environment.outputs.enviroment_cd }}
CI_TYPE: main