Skip to content

Commit 749116f

Browse files
authored
Make semaphore pipeline run less frequently, reduce machine sizes, avoid clearing cache (#362)
* Make semaphore pipeline run less frequently, reduce machine sizes, avoid clearing cache * Fix change_in * Add pipeline ignore temporarily to change in * Test changes for change_in pipeline * Test changes for change_in pipeline - 2 * Remove /deps - change in deps will be change in util.js also, so it's not needed * Don't make pipelines run repeatedly on master when they're running on PR anyway * Remove testing changes * Add cache store/restore * Add cache store/restore - fix * Add cache store/restore - if for public * Remove unrequired workflows and use npm ci for alpine * Use commit hash rather than version to avoid cloning
1 parent aa7748d commit 749116f

File tree

4 files changed

+30
-82
lines changed

4 files changed

+30
-82
lines changed

.github/workflows/npm-publish.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.semaphore/build-docker-alpine.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
apk add -U ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils perl patch musl-dev bash
77
# /v is the volume mount point for the project root
88
cd /v
9-
npm install
9+
npm ci
1010
npx node-pre-gyp package

.semaphore/semaphore.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,22 @@ global_job_config:
2525
prologue:
2626
commands:
2727
- checkout
28+
- export LIBRDKAFKA_COMMIT_HASH="librdkafka_$(git submodule status deps/librdkafka | cut -d' ' -f1)"
29+
- if [[ $(command cache) ]]; then cache restore "$LIBRDKAFKA_COMMIT_HASH" ; fi
2830
- git submodule update --init --recursive
29-
- cd deps/librdkafka
30-
- git fetch origin
31-
- git checkout v2.11.1
32-
- cd ../../
33-
- cache clear
31+
epilogue:
32+
commands:
33+
- if [[ $(command cache) ]]; then cache store "$LIBRDKAFKA_COMMIT_HASH" deps/librdkafka; done
3434

3535
blocks:
3636
- name: "Linux amd64 (musl): Build and test"
37+
run:
38+
when: "change_in(['/package.json', '/lib', '/src', '/test']) AND tag !~ '^v[0-9]\\.'"
3739
dependencies: [ ]
3840
task:
3941
agent:
4042
machine:
41-
type: s1-prod-ubuntu24-04-amd64-2
43+
type: s1-prod-ubuntu24-04-amd64-1
4244
prologue:
4345
commands:
4446
- '[[ -z $DOCKERHUB_APIKEY ]] || docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY'
@@ -48,6 +50,8 @@ blocks:
4850
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker-alpine.sh
4951

5052
- name: "Linux arm64 (musl): Build and test"
53+
run:
54+
when: "change_in(['/package.json', '/lib', '/src', '/test']) AND tag !~ '^v[0-9]\\.'"
5155
dependencies: [ ]
5256
task:
5357
agent:
@@ -61,12 +65,14 @@ blocks:
6165
commands:
6266
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker-alpine.sh
6367

64-
- name: "Linux arm64: Build and test"
68+
- name: "Linux amd64: Build and test"
69+
run:
70+
when: "change_in(['/package.json', '/lib', '/src', '/test']) AND tag !~ '^v[0-9]\\.'"
6571
dependencies: [ ]
6672
task:
6773
agent:
6874
machine:
69-
type: s1-prod-ubuntu24-04-arm64-1
75+
type: s1-prod-ubuntu24-04-amd64-1
7076
jobs:
7177
- name: "Build from source and test"
7278
commands:
@@ -75,6 +81,8 @@ blocks:
7581
- make test
7682

7783
- name: 'macOS arm64/m1: Build and test'
84+
run:
85+
when: "change_in(['/package.json', '/lib', '/src', '/test']) AND tag !~ '^v[0-9]\\.'"
7886
dependencies: []
7987
task:
8088
agent:
@@ -87,16 +95,20 @@ blocks:
8795
- npm run install-from-source
8896
- make test
8997

90-
- name: "Linux amd64: Build, test, lint, docs"
98+
- name: "Linux arm64: Build, test, lint, docs"
99+
skip:
100+
when: "tag =~ '^v[0-9]\\.'"
91101
dependencies: [ ]
92102
task:
93103
agent:
94104
machine:
95-
type: s1-prod-ubuntu24-04-amd64-2
105+
type: s1-prod-ubuntu24-04-arm64-1
96106
prologue:
97107
commands:
98108
- export CKJS_LINKING=dynamic
109+
- if [[ $(command cache) ]]; then cache restore; fi
99110
- npm run install-from-source
111+
- if [[ $(command cache) ]]; then cache store; fi
100112
jobs:
101113
- name: "Test"
102114
commands:
@@ -125,11 +137,13 @@ blocks:
125137
- make docs
126138

127139
- name: "(SR) Linux amd64: test, e2e"
140+
run:
141+
when: "change_in(['/package.json', '/schemaregistry', '/schemaregistry-examples', '/proto']) AND tag !~ '^v[0-9]\\.'"
128142
dependencies: [ ]
129143
task:
130144
agent:
131145
machine:
132-
type: s1-prod-ubuntu24-04-amd64-2
146+
type: s1-prod-ubuntu24-04-amd64-1
133147
prologue:
134148
commands:
135149
- npm install
@@ -146,6 +160,8 @@ blocks:
146160
- make integtest
147161

148162
- name: "Linux amd64: Performance"
163+
run:
164+
when: "change_in(['/package.json', '/lib', '/src', '/ci/tests']) AND tag !~ '^v[0-9]\\.'"
149165
dependencies: [ ]
150166
task:
151167
agent:
@@ -188,7 +204,7 @@ blocks:
188204
task:
189205
agent:
190206
machine:
191-
type: s1-prod-ubuntu24-04-amd64-2
207+
type: s1-prod-ubuntu24-04-amd64-1
192208
env_vars:
193209
- name: ARCHITECTURE
194210
value: "x64"
@@ -476,7 +492,7 @@ blocks:
476492
task:
477493
agent:
478494
machine:
479-
type: s1-prod-ubuntu24-04-amd64-2
495+
type: s1-prod-ubuntu24-04-amd64-1
480496
jobs:
481497
- name: "Tarball"
482498
commands:

0 commit comments

Comments
 (0)