-
Notifications
You must be signed in to change notification settings - Fork 1.9k
151 lines (127 loc) · 3.87 KB
/
ci-go.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: ["main"]
pull_request:
types: [opened, edited, synchronize]
jobs:
build:
name: build and test
timeout-minutes: 15
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18.0
cache: true
cache-dependency-path: cli/go.sum
- name: Set Up Protoc
uses: arduino/setup-protoc@v1
with:
version: "3.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set Up Go and GRPC protobuf
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
- uses: pnpm/[email protected]
with:
version: 7.2.1
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 16
cache: pnpm
- name: Configure corepack
# Forcibly upgrade our available version of corepack.
# The bundled version in node 16 has known issues.
# Prepends the corepack bin dir so that it is always first.
shell: bash
run: |
npm install --force --global corepack@latest
npm config get prefix >> $GITHUB_PATH
corepack enable
- name: Install dependencies
run: pnpm install
- name: Build & Unit Test
run: pnpm -- turbo run test --filter=cli --color
- name: E2E Tests
run: pnpm -- turbo run e2e --filter=cli
examples:
name: run examples
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
manager: [yarn, npm]
example: [basic, design-system, kitchen-sink]
include:
- os: ubuntu-latest
manager: pnpm
example: with-pnpm
- os: macos-latest
manager: pnpm
example: with-pnpm
runs-on: ${{ matrix.os }}
steps:
- name: Install Sponge
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y moreutils
else
brew install moreutils
fi
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Go 1
uses: actions/setup-go@v3
with:
go-version: 1.18.0
cache: true
cache-dependency-path: cli/go.sum
- name: Set Up Protoc
uses: arduino/setup-protoc@v1
with:
version: "3.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set Up Go and GRPC protobuf
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
- uses: pnpm/[email protected]
with:
version: 7.2.1
- name: Make sure pnpm always has a cache
shell: bash
run: |
mkdir -p `pnpm store path`
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 16
cache: ${{matrix.manager}}
cache-dependency-path: package.json
- name: Check ${{matrix.example}} example with ${{ matrix.manager }}
shell: bash
env:
FORCE_COLOR: true
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
run: pnpm -- turbo run run-example -- "${{ matrix.example }}" "${{ matrix.manager }}"