Repository navigation
97 lines (82 loc) · 2.36 KB
/
Copy pathcicd.yml
File metadata and controls
97 lines (82 loc) · 2.36 KB
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
name: cicd
on: [push,pull_request]
env:
CHUB: ${{ 'docker.io' }}
CHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
CHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GOMS_NAME_SPACE: ${{ secrets.DOCKER_USERNAME }}
CI_ENV_DOCKER: ${{ 'no' }}
RHUB: ${{ 'docker.pkg.github.com' }}
RHUB_USERNAME: ${{ github.repository_owner }}
RHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RSPACE: ${{ github.repository }}
jobs:
env:
name: env
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Print env
run: |
whoami
pwd
which go
which docker
groups $(whoami)
ls -a -l ./
go env GOPROXY
docker images
git log -1 --oneline
echo "==> github.repository_owner: ${{ github.repository_owner }}"
echo "==> github.repository: ${{ github.repository }}"
echo "==> github.ref: ${{ github.ref }}"
echo "==> ${{ contains(github.ref, 'refs/heads/release') }}"
echo "==> ${{ contains(github.ref, 'refs/tags/v') }}"
run:
name: run
runs-on: ubuntu-latest
services:
mysql:
image: dockerxpub/mysqltest:v2.2.2
ports:
- 3306:3306
redis:
image: dockerxpub/redistest:v1.4.3
ports:
- 6379:6379
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build mock
working-directory: ./tests/mock/build
run: |
docker login ${CHUB} -u ${CHUB_USERNAME} -p ${CHUB_PASSWORD}
chmod +x ./build.sh && ./build.sh
- name: Unit test
working-directory: ./tests/unit
run: |
bash ./run.sh
- name: Build
working-directory: ./build
run: |
docker login ${CHUB} -u ${CHUB_USERNAME} -p ${CHUB_PASSWORD}
chmod +x ./build.sh && ./build.sh
- name: Integration test
working-directory: ./tests/integration
run: |
source ./install.sh
bash ./run.sh
cat ./test.log
- name: Other test
run: |
echo "==> Other test"
echo "==> Deploy to cluster"
echo "==> Testing ..."
echo "==> Test PASS"
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
working-directory: ./eApi/build
run: |
echo "${RHUB_TOKEN}" | docker login ${RHUB} -u ${RHUB_USERNAME} --password-stdin
make release