Skip to content

Commit c2a13fc

Browse files
committed
Reduce number of CI jobs
1 parent 1041485 commit c2a13fc

5 files changed

Lines changed: 158 additions & 106 deletions

File tree

.github/actions/build-docker/action.yml

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
name: 'Meteor Docker'
1+
name: 'Build Docker'
22

33
inputs:
44
CR_USER:
55
required: true
66
CR_PAT:
77
required: true
8-
node-version:
9-
required: true
10-
description: 'Node version'
11-
type: string
128
deno-version:
139
required: true
1410
description: 'Deno version'
@@ -25,13 +21,10 @@ inputs:
2521
required: false
2622
description: 'Publish image'
2723
default: 'true'
28-
setup:
29-
required: false
30-
description: 'Setup node.js'
31-
default: 'true'
32-
NPM_TOKEN:
24+
setup-docker:
3325
required: false
34-
description: 'NPM token'
26+
description: 'Setup Docker'
27+
default: true
3528
type:
3629
required: false
3730
description: 'production or coverage'
@@ -49,17 +42,6 @@ runs:
4942
username: ${{ inputs.CR_USER }}
5043
password: ${{ inputs.CR_PAT }}
5144

52-
- name: Restore packages build
53-
uses: actions/download-artifact@v6
54-
with:
55-
name: packages-build
56-
path: /tmp
57-
58-
- name: Unpack packages build
59-
shell: bash
60-
run: |
61-
tar -xzf /tmp/RocketChat-packages-build.tar.gz -C .
62-
6345
- name: Restore meteor build
6446
if: inputs.service == 'rocketchat'
6547
uses: actions/download-artifact@v6
@@ -76,20 +58,17 @@ runs:
7658
rm Rocket.Chat.tar.gz
7759
7860
- name: Set up Docker
61+
if: inputs.setup-docker == true
7962
uses: docker/setup-docker-action@v4
8063
with:
8164
daemon-config: |
8265
{
83-
"debug": true,
66+
"debug": false,
8467
"features": {
8568
"containerd-snapshotter": true
8669
}
8770
}
8871
89-
- uses: docker/setup-buildx-action@v3
90-
with:
91-
buildkitd-flags: --oci-worker-gc --oci-worker-gc-keepstorage=4000
92-
9372
- name: Build Docker images
9473
shell: bash
9574
run: |
@@ -122,10 +101,12 @@ runs:
122101
echo "Contents of /tmp/meta.json:"
123102
cat /tmp/meta.json
124103
125-
mkdir -p /tmp/digests/${{ inputs.service }}${{ inputs.type == 'coverage' && '-cov' || '' }}/${{ inputs.arch }}
104+
SERVICE_SUFFIX=${{ inputs.service == 'rocketchat' && inputs.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
105+
106+
mkdir -p /tmp/digests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}
126107
DIGEST=$(jq -r '.["${{ inputs.service }}"].["containerimage.digest"]' "/tmp/meta.json")
127108
IMAGE_NO_TAG=$(echo "$IMAGE" | sed 's/:.*$//')
128-
echo "${IMAGE_NO_TAG}@${DIGEST}" > "/tmp/digests/${{ inputs.service }}${{ inputs.type == 'coverage' && '-cov' || '' }}/${{ inputs.arch }}/digest.txt"
109+
echo "${IMAGE_NO_TAG}@${DIGEST}" > "/tmp/digests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/digest.txt"
129110
130111
- uses: actions/upload-artifact@v4
131112
if: inputs.publish-image == 'true'

.github/actions/meteor-build/action.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ runs:
3434
id: cache-build
3535
with:
3636
path: /tmp/Rocket.Chat.tar.gz
37-
key: ${{ runner.OS }}-rc-build-${{ inputs.source-hash }}
38-
restore-keys: |
39-
${{ runner.os }}-rc-build-
37+
key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-rc-build-${{ inputs.source-hash }}
4038

4139
- name: Set Swap Space
4240
uses: pierotofy/set-swap-space@master
@@ -65,27 +63,27 @@ runs:
6563
if: steps.cache-build.outputs.cache-hit != 'true'
6664
with:
6765
path: ./node_modules/.vite
68-
key: vite-local-cache-${{ runner.OS }}-${{ hashFiles('package.json') }}
66+
key: vite-local-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json') }}
6967
restore-keys: |
70-
vite-local-cache-${{ runner.os }}-
68+
vite-local-cache-${{ runner.os }}-${{ runner.arch }}-
7169
7270
- name: Cache meteor local
7371
uses: actions/cache@v3
7472
if: steps.cache-build.outputs.cache-hit != 'true'
7573
with:
7674
path: ./apps/meteor/.meteor/local
77-
key: meteor-local-cache-${{ runner.OS }}-${{ hashFiles('apps/meteor/.meteor/versions') }}
75+
key: meteor-local-cache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-${{ hashFiles('apps/meteor/.meteor/versions') }}
7876
restore-keys: |
79-
meteor-local-cache-${{ runner.os }}-
77+
meteor-local-cache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-
8078
8179
- name: Cache meteor
8280
uses: actions/cache@v3
8381
if: steps.cache-build.outputs.cache-hit != 'true'
8482
with:
8583
path: ~/.meteor
86-
key: meteor-cache-${{ runner.OS }}-${{ hashFiles('apps/meteor/.meteor/release') }}
84+
key: meteor-cache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-${{ hashFiles('apps/meteor/.meteor/release') }}
8785
restore-keys: |
88-
meteor-cache-${{ runner.os }}-
86+
meteor-cache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-
8987
9088
- name: Install Meteor
9189
shell: bash

.github/actions/setup-playwright/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ runs:
1111
path: |
1212
~/.cache/ms-playwright
1313
# This is the version of Playwright that we are using, if you are willing to upgrade, you should update this.
14-
key: playwright-1.52.0
14+
key: playwright-${{ runner.os }}-${{ runner.arch }}-1.52.0
1515

1616
- name: Install Playwright
1717
shell: bash
1818
if: steps.cache-playwright.outputs.cache-hit != 'true'
1919
working-directory: .
2020
run: npx playwright install --with-deps
21-

.github/workflows/ci-test-e2e.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
transporter:
2121
type: string
2222
mongodb-version:
23-
default: "['5.0', '8.2']"
23+
default: "['8.2']"
2424
required: false
2525
type: string
2626
release:
@@ -41,6 +41,9 @@ on:
4141
type:
4242
required: true
4343
type: string
44+
coverage:
45+
required: false
46+
type: string
4447
db-watcher-disabled:
4548
default: 'true'
4649
required: false
@@ -66,12 +69,15 @@ env:
6669
TOOL_NODE_FLAGS: ${{ vars.TOOL_NODE_FLAGS }}
6770
LOWERCASE_REPOSITORY: ${{ inputs.lowercase-repo }}
6871
DOCKER_TAG: ${{ inputs.gh-docker-tag }}
69-
DOCKER_TAG_SUFFIX_ROCKETCHAT: '-cov'
7072

7173
jobs:
7274
test:
7375
runs-on: ubuntu-24.04
7476

77+
env:
78+
# if building for production on develop branch or release, add suffix for coverage images
79+
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ inputs.coverage == matrix.mongodb-version && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
80+
7581
strategy:
7682
fail-fast: false
7783
matrix:
@@ -138,12 +144,9 @@ jobs:
138144
with:
139145
CR_USER: ${{ secrets.CR_USER }}
140146
CR_PAT: ${{ secrets.CR_PAT }}
141-
node-version: ${{ inputs.node-version }}
142147
# the same reason we need to rebuild the docker image at this point is the reason we dont want to publish it
143148
publish-image: false
144-
setup: false
145149
service: 'rocketchat'
146-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
147150

148151
- name: Set DEBUG_LOG_LEVEL (debug enabled)
149152
if: runner.debug == '1'
@@ -155,7 +158,7 @@ jobs:
155158
docker compose -f docker-compose-ci.yml up -d httpbin
156159
157160
- name: Prepare code coverage directory
158-
if: inputs.release == 'ee'
161+
if: inputs.coverage == matrix.mongodb-version
159162
run: |
160163
mkdir -p /tmp/coverage
161164
chmod 777 /tmp/coverage
@@ -215,7 +218,7 @@ jobs:
215218
- name: E2E Test UI (${{ matrix.shard }}/${{ inputs.total-shard }})
216219
if: inputs.type == 'ui'
217220
env:
218-
E2E_COVERAGE: ${{ inputs.release == 'ee' && 'true' || '' }}
221+
E2E_COVERAGE: ${{ inputs.coverage == matrix.mongodb-version && 'true' || '' }}
219222
IS_EE: ${{ inputs.release == 'ee' && 'true' || '' }}
220223
REPORTER_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_ROCKETCHAT_API_KEY }}
221224
REPORTER_ROCKETCHAT_URL: ${{ secrets.REPORTER_ROCKETCHAT_URL }}

0 commit comments

Comments
 (0)