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

Commit 8c4a962

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 8c4a962

File tree

3 files changed

+45
-15
lines changed

3 files changed

+45
-15
lines changed

.github/workflows/build.yaml

Lines changed: 26 additions & 4 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,29 +16,45 @@ 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-*
17-
build_darwin:
24+
25+
build_darwin_pull:
1826
runs-on: macos-latest
27+
if: github.ref != 'refs/heads/master'
1928
steps:
2029
- name: Checkout
21-
uses: actions/checkout@v1
30+
uses: actions/checkout@v2
31+
- name: Build
32+
run: unset CI && make build/macos
33+
34+
build_darwin_master:
35+
runs-on: macos-latest
36+
if: github.ref == 'refs/heads/master'
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v2
40+
2241
- name: Install Gon
2342
run: |
2443
brew tap mitchellh/gon
2544
brew install mitchellh/gon/gon
45+
2646
- name: Import Signing Certificates
2747
uses: Apple-Actions/import-codesign-certs@v1
2848
with:
2949
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
3050
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
31-
- name: Build
51+
52+
- name: Build master
3253
run: make build/macos
3354
env:
3455
AC_USERNAME: ${{ secrets.AC_USERNAME }}
3556
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
57+
3658
- name: Upload
3759
uses: actions/upload-artifact@v2
3860
with:

.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)