forked from juju/juju
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.16 KB
/
client-tests.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
name: "Client Tests"
on:
push:
branches: [2.9, 3.1, 3.2, 3.3, main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/client-tests.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
test-client-ubuntu:
name: "Client Tests"
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
# windows tests is disabled because we require a certain version of
# mongo (that's actually going away now though), and choclately was
# failing to install it correctly.
# os: [ubuntu-latest, macOS-latest, windows-latest]
os: [macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- name: "Install Mongo Dependencies: ubuntu-latest"
if: (matrix.os == 'ubuntu-latest')
run: |
make install-mongo-dependencies
- name: "Install Mongo Dependencies: macOS-latest"
if: (matrix.os == 'macOS-latest')
run: |
brew tap mongodb/brew
brew update
brew install mongodb-community@4.4
brew link mongodb-community@4.4
brew services start mongodb/brew/mongodb-community@4.4
- name: "Remove Mongo Dependencies: windows-latest"
if: (matrix.os == 'windows-latest')
uses: crazy-max/ghaction-chocolatey@b59ffdb6594d2e2c36d9e1174e15ac799dd0a8f1 # v1
with:
args: uninstall mongodb mongodb.install -y --all-versions
- name: "Install Mongo Dependencies: windows-latest"
if: (matrix.os == 'windows-latest')
uses: crazy-max/ghaction-chocolatey@b59ffdb6594d2e2c36d9e1174e15ac799dd0a8f1 # v1
with:
args: install mongodb.install --version=4.4.11 --allow-downgrade
- name: "Test client"
run: |
# Jenkins can perform the full jujud testing.
go test -race -v ./cmd/juju/... -check.v -coverprofile=coverage.txt -covermode=atomic -timeout=15m
go test -race -v ./cmd/plugins/... -check.v
shell: bash