-
Notifications
You must be signed in to change notification settings - Fork 7
133 lines (112 loc) · 3.98 KB
/
go-collab.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Gitconvex Collaboration Server Pipeline
on:
pull_request:
branches: [ main ]
jobs:
libgit2-setup-test:
name: Setup Libgit2 with Homebrew
runs-on: ubuntu-latest
steps:
- name: Install libssh2 and libgit2
run: |
brew install libssh2
brew install libgit2
gitconvex-test:
name: Gitconvex server test
runs-on: ubuntu-latest
env:
PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.1/lib/pkgconfig/
GITCONVEX_TEST_REPO: /home/runner/work/gitconvex-server/gitconvex-test
GITCONVEX_DEFAULT_PATH: /usr/local/gitconvex
steps:
- name: Install libgit2 from Homebrew
run: |
brew install libssh2
brew install libgit2
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup Test Artifacts
run: |
sudo cp /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.1/lib/lib* /usr/lib
export PATH="/home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.1/lib/:$PATH"
git config --global user.name "${{ secrets.ACTION_USER_NAME }}" && git config --global user.email "${{ secrets.ACTION_USER_EMAIL }}"
sudo mkdir -p /usr/local/gitconvex
sudo chown $(whoami) /usr/local/gitconvex/
- name: Run Go Test
shell: bash
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make test-ci-pretty
gitconvex-build:
needs:
- gitconvex-test
- libgit2-setup-test
name: Gitconvex Build
runs-on: ubuntu-latest
env:
PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.1/lib/pkgconfig/
steps:
- name: Install libgit2 from Homebrew
run: |
brew install libssh2
brew install libgit2
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build Go bundle
run: go build -v .
gitconvex-mock-integration:
needs:
- libgit2-setup-test
- gitconvex-test
- gitconvex-build
name: Mocking Gitconvex Unified Repo Integration
runs-on: ubuntu-latest
env:
PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.1/lib/pkgconfig/
steps:
- name: Install libgit2 from Homebrew
run: |
brew install libssh2
brew install libgit2
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Test deployment prep to integrated repo
run: |
export TARGET_BRANCH=${{ secrets.TARGET_BRANCH }}
git clone https://github.com/neel1996/gitconvex-server.git $HOME/gitconvex-server
cd $HOME/gitconvex-server
git checkout ${{ github.head_ref }}
export LATEST_COMMIT=$(git log --oneline -1 --pretty=format:%s)
git clone https://github.com/neel1996/gitconvex.git $HOME/gitconvex
git config --global user.name "${{ secrets.ACTION_USER_NAME }}" && git config --global user.email "${{ secrets.ACTION_USER_EMAIL }}"
cd $HOME/gitconvex
git checkout $TARGET_BRANCH
cd $GITHUB_WORKSPACE
rm README.md
rm -rf .git/ .github/ .gitignore gitconvex-server
cp -rp * $HOME/gitconvex/
cd $HOME/gitconvex/
rm -rf libgit2-1.1.0*
echo "Commit Message --> $LATEST_COMMIT"
git status
git add --all
git commit -m "$LATEST_COMMIT"
git log -1