This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 154
100 lines (82 loc) · 2.28 KB
/
test.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
name: Test
on:
push:
branches:
- master
- "release-*"
pull_request:
permissions:
contents: read
jobs:
check-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- name: check docs
run: |
echo "Making sure docs are updated"
make docs
if [[ -n $(git status --porcelain) ]]; then echo "Please update the docs using make docs"; exit 1; fi
mm-govet:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- name: check lints
run: |
echo "Installing mattermost-govet"
go env GOPATH
go install github.com/mattermost/mattermost-govet@master
make gofmt govet
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: mmctl
- name: Checkout mm-server
uses: actions/checkout@v2
with:
repository: mattermost/mattermost-server
ref: release-7.10 # we are referencing the latest release pre mono-repo
path: mattermost-server
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- name: Setup mattermost-server
working-directory: mattermost-server
run: |
SERVER_HEAD=$GITHUB_HEAD_REF;
if [[ $GITHUB_HEAD_REF == "master" || $GITHUB_HEAD_REF == "mono-repo" || $GITHUB_HEAD_REF == "" ]]
then
SERVER_HEAD="release-7.10"
fi;
echo $SERVER_HEAD;
git checkout $SERVER_HEAD || git checkout "release-7.10"
- name: Start containers
working-directory: mattermost-server/build
env:
COMPOSE_PROJECT_NAME: "actions"
run: ../../mmctl/scripts/start-docker-compose.sh
- name: Wait for docker compose
working-directory: mmctl
env:
COMPOSE_PROJECT_NAME: "actions"
run: ./scripts/wait-docker-compose.sh
- name: Run Tests
working-directory: mattermost-server/build
env:
COMPOSE_PROJECT_NAME: "actions"
run: ../../mmctl/scripts/run-tests-ci.sh