Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 97bb75d

Browse files
committed
chore: clean up CI scripts
* Skip signing and notarizing Darwin binary in pull requests, since this takes a long time and is done in the master build * Avoid uploading built artifacts for pull request builds * Only build/test for pull requests against master
1 parent 4eafe01 commit 97bb75d

File tree

3 files changed

+40
-14
lines changed

3 files changed

+40
-14
lines changed

.github/workflows/build.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: build
2-
on: [push]
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
39

410
jobs:
511
build:
@@ -10,30 +16,42 @@ jobs:
1016
- name: Build
1117
run: make -j build/linux build/windows
1218
- name: Upload
19+
if: github.ref == 'refs/heads/master'
1320
uses: actions/upload-artifact@v2
1421
with:
1522
name: coder-cli
1623
path: ./ci/bin/coder-cli-*
24+
1725
build_darwin:
1826
runs-on: macos-latest
1927
steps:
2028
- name: Checkout
21-
uses: actions/checkout@v1
29+
uses: actions/checkout@v2
2230
- name: Install Gon
31+
if: github.ref == 'refs/heads/master'
2332
run: |
2433
brew tap mitchellh/gon
2534
brew install mitchellh/gon/gon
2635
- name: Import Signing Certificates
36+
if: github.ref == 'refs/heads/master'
2737
uses: Apple-Actions/import-codesign-certs@v1
2838
with:
2939
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
3040
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
31-
- name: Build
41+
- name: Build master
42+
if: github.ref == 'refs/heads/master'
3243
run: make build/macos
3344
env:
3445
AC_USERNAME: ${{ secrets.AC_USERNAME }}
3546
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
47+
- name: Build pull request
48+
if: github.ref != 'refs/heads/master'
49+
run: CI=false make build/macos
50+
env:
51+
AC_USERNAME: ${{ secrets.AC_USERNAME }}
52+
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
3653
- name: Upload
54+
if: github.ref == 'refs/heads/master'
3755
uses: actions/upload-artifact@v2
3856
with:
3957
name: coder-cli

.github/workflows/integration.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: integration
22
on:
33
push:
4+
branches:
5+
- master
46
schedule:
57
- cron: '*/180 * * * *'
68

@@ -12,15 +14,15 @@ jobs:
1214
CODER_EMAIL: ${{ secrets.CODER_EMAIL }}
1315
CODER_PASSWORD: ${{ secrets.CODER_PASSWORD }}
1416
steps:
15-
- uses: actions/checkout@v1
16-
- uses: actions/cache@v1
17+
- uses: actions/checkout@v2
18+
- uses: actions/cache@v2
1719
with:
1820
path: ~/go/pkg/mod
1921
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
2022
restore-keys: |
2123
${{ runner.os }}-go-
2224
- uses: actions/setup-go@v2
2325
with:
24-
go-version: '^1.14'
26+
go-version: '^1.15'
2527
- name: integration tests
2628
run: ./ci/scripts/integration.sh

.github/workflows/test.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: test
2-
on: [push]
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
39

410
jobs:
511
fmt:
612
runs-on: ubuntu-latest
713
steps:
8-
- uses: actions/checkout@v1
9-
- uses: actions/cache@v1
14+
- uses: actions/checkout@v2
15+
- uses: actions/cache@v2
1016
with:
1117
path: ~/go/pkg/mod
1218
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -25,12 +31,12 @@ jobs:
2531
uses: golangci/golangci-lint-action@v2
2632
with:
2733
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
28-
version: v1.29
34+
version: v1.36
2935
test:
3036
runs-on: ubuntu-latest
3137
steps:
32-
- uses: actions/checkout@v1
33-
- uses: actions/cache@v1
38+
- uses: actions/checkout@v2
39+
- uses: actions/cache@v2
3440
with:
3541
path: ~/go/pkg/mod
3642
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -43,8 +49,8 @@ jobs:
4349
gendocs:
4450
runs-on: ubuntu-latest
4551
steps:
46-
- uses: actions/checkout@v1
47-
- uses: actions/cache@v1
52+
- uses: actions/checkout@v2
53+
- uses: actions/cache@v2
4854
with:
4955
path: ~/go/pkg/mod
5056
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

0 commit comments

Comments
 (0)