Skip to content

Commit 20c8e89

Browse files
authored
chore(ci): Speedup workflows (#8448)
1 parent c2f39ff commit 20c8e89

File tree

7 files changed

+63
-98
lines changed

7 files changed

+63
-98
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
npm:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-24.04
1212
timeout-minutes: 30
1313
permissions:
1414
contents: write
@@ -39,8 +39,6 @@ jobs:
3939
${{ runner.os }}-yarn-
4040
- name: Set Yarn version
4141
run: yarn policies set-version v1.22.19
42-
- name: Copy yarn.lock file
43-
run: cp yarn.lock packages/cubejs-docker
4442
- name: Yarn install
4543
uses: nick-fields/retry@v3
4644
env:
@@ -106,19 +104,9 @@ jobs:
106104
run: npm install -g yarn
107105
- name: Set Yarn version
108106
run: yarn policies set-version v1.22.19
109-
- name: Get yarn cache directory path
110-
id: yarn-cache-dir-path
111-
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
112-
shell: bash
113-
- name: Restore yarn cache
114-
uses: actions/cache@v4
115-
with:
116-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
117-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
118-
restore-keys: |
119-
${{ runner.os }}-yarn-
120-
- name: Copy yarn.lock file
121-
run: cp yarn.lock packages/cubejs-docker
107+
# We don't need to install all yarn deps to build native
108+
- name: Install cargo-cp-artifact
109+
run: npm install -g [email protected]
122110
- name: Yarn install
123111
uses: nick-fields/retry@v3
124112
env:
@@ -219,21 +207,11 @@ jobs:
219207
uses: actions/setup-node@v4
220208
with:
221209
node-version: ${{ matrix.node-version }}
222-
- name: Get yarn cache directory path
223-
id: yarn-cache-dir-path
224-
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
225-
shell: bash
226-
- name: Restore yarn cache
227-
uses: actions/cache@v4
228-
with:
229-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
230-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
231-
restore-keys: |
232-
${{ runner.os }}-yarn-
233210
- name: Set Yarn version
234211
run: yarn policies set-version v1.22.19
235-
- name: Copy yarn.lock file
236-
run: cp yarn.lock packages/cubejs-docker
212+
# We don't need to install all yarn deps to build native
213+
- name: Install cargo-cp-artifact
214+
run: npm install -g [email protected]
237215
- name: Yarn install
238216
uses: nick-fields/retry@v3
239217
env:
@@ -315,21 +293,11 @@ jobs:
315293
uses: actions/setup-node@v4
316294
with:
317295
node-version: ${{ matrix.node-version }}
318-
- name: Get yarn cache directory path
319-
id: yarn-cache-dir-path
320-
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
321-
shell: bash
322-
- name: Restore yarn cache
323-
uses: actions/cache@v4
324-
with:
325-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
326-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
327-
restore-keys: |
328-
${{ runner.os }}-yarn-
329296
- name: Set Yarn version
330297
run: yarn policies set-version v1.22.19
331-
- name: Copy yarn.lock file
332-
run: cp yarn.lock packages/cubejs-docker
298+
# We don't need to install all yarn deps to build native
299+
- name: Install cargo-cp-artifact
300+
run: npm install -g [email protected]
333301
- name: Yarn install
334302
uses: nick-fields/retry@v3
335303
env:
@@ -455,7 +423,7 @@ jobs:
455423
docker-debian-jdk:
456424
needs: [npm, cubestore_linux, native_linux]
457425
name: Debian with jdk docker image
458-
runs-on: ubuntu-20.04
426+
runs-on: ubuntu-24.04
459427
timeout-minutes: 30
460428
permissions:
461429
contents: write
@@ -536,7 +504,7 @@ jobs:
536504
fail-fast: false
537505
matrix:
538506
include:
539-
- os: ubuntu-20.04
507+
- os: ubuntu-24.04
540508
target: x86_64-unknown-linux-gnu
541509
platforms: linux/amd64
542510
build-args: WITH_AVX2=1
@@ -549,7 +517,7 @@ jobs:
549517
postfix: "-arm64v8"
550518
tag: "arm64v8"
551519
# Non AVX build
552-
- os: ubuntu-20.04
520+
- os: ubuntu-24.04
553521
target: x86_64-unknown-linux-gnu
554522
platforms: linux/amd64
555523
build-args: WITH_AVX2=0
@@ -766,7 +734,7 @@ jobs:
766734
run: vcpkg integrate install; vcpkg install openssl:x64-windows
767735
- name: Instal LLVM for Windows
768736
if: ${{ startsWith(matrix.os, 'windows') }}
769-
run: choco install -y --force llvm --version 18.1.2
737+
run: choco install -y --force llvm --version 18.1.6
770738
- name: Set Env Variables for Windows
771739
uses: allenevans/[email protected]
772740
if: ${{ startsWith(matrix.os, 'windows') }}

.github/workflows/rust-cubestore-master.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,7 @@ jobs:
142142
username: ${{ secrets.DOCKERHUB_USERNAME }}
143143
password: ${{ secrets.DOCKERHUB_TOKEN }}
144144
- name: Set up Docker Buildx
145-
uses: docker/setup-buildx-action@v2
146-
with:
147-
version: v0.9.1
148-
- name: Cache Docker layers
149-
uses: actions/cache@v3
150-
with:
151-
path: /tmp/.buildx-cache
152-
key: ${{ runner.os }}-${{ matrix.target }}-buildx-${{ github.sha }}
153-
restore-keys: |
154-
${{ runner.os }}-${{ matrix.target }}-buildx-
145+
uses: docker/setup-buildx-action@v3
155146
- name: Push to Docker Hub
156147
uses: docker/build-push-action@v3
157148
with:
@@ -161,8 +152,8 @@ jobs:
161152
build-args: ${{ matrix.build-args }}
162153
push: true
163154
tags: ${{ steps.prep.outputs.tags }}
164-
cache-from: type=local,src=/tmp/.buildx-cache
165-
cache-to: type=local,dest=/tmp/.buildx-cache
155+
cache-from: type=gha
156+
cache-to: type=gha,mode=max
166157
labels: |
167158
org.opencontainers.image.title=${{ fromJson(steps.repo.outputs.result).name }}
168159
org.opencontainers.image.description=${{ fromJson(steps.repo.outputs.result).description }}
@@ -223,7 +214,7 @@ jobs:
223214
run: vcpkg integrate install; vcpkg install openssl:x64-windows
224215
- name: Instal LLVM for Windows
225216
if: ${{ startsWith(matrix.os, 'windows') }}
226-
run: choco install -y --force llvm --version 18.1.2
217+
run: choco install -y --force llvm --version 18.1.6
227218
- name: Set Env Variables for Windows
228219
uses: allenevans/[email protected]
229220
if: ${{ startsWith(matrix.os, 'windows') }}

.github/workflows/rust-cubestore.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,7 @@ jobs:
9090
- name: Checkout
9191
uses: actions/checkout@v4
9292
- name: Set up Docker Buildx
93-
uses: docker/setup-buildx-action@v2
94-
with:
95-
version: v0.9.1
96-
- name: Cache Docker layers
97-
uses: actions/cache@v3
98-
with:
99-
path: /tmp/.buildx-cache
100-
key: ${{ runner.os }}-${{ matrix.target }}-buildx-${{ github.sha }}
101-
restore-keys: |
102-
${{ runner.os }}-${{ matrix.target }}-buildx-
93+
uses: docker/setup-buildx-action@v3
10394
- name: Build only
10495
uses: docker/build-push-action@v3
10596
with:
@@ -108,8 +99,8 @@ jobs:
10899
platforms: ${{ matrix.platforms }}
109100
build-args: ${{ matrix.build-args }}
110101
push: false
111-
cache-from: type=local,src=/tmp/.buildx-cache
112-
cache-to: type=local,dest=/tmp/.buildx-cache
102+
cache-from: type=gha
103+
cache-to: type=gha,mode=max
113104

114105
cubestore:
115106
runs-on: ${{ matrix.os }}
@@ -154,7 +145,7 @@ jobs:
154145
run: vcpkg integrate install; vcpkg install openssl:x64-windows
155146
- name: Instal LLVM for Windows
156147
if: ${{ startsWith(matrix.os, 'windows') }}
157-
run: choco install -y --force llvm --version 18.1.2
148+
run: choco install -y --force llvm --version 18.1.6
158149
- name: Set Env Variables for Windows
159150
uses: allenevans/[email protected]
160151
if: ${{ startsWith(matrix.os, 'windows') }}

rust/cubestore/Dockerfile

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,4 @@
1-
FROM rust:1-bookworm AS builder
2-
3-
RUN rustup update && \
4-
rustup default nightly-2024-01-10 && \
5-
rustup component add --toolchain nightly-2024-01-10 rustfmt;
6-
7-
RUN apt update \
8-
&& apt upgrade -y \
9-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common pkg-config wget gnupg git apt-transport-https ca-certificates \
10-
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
11-
# https://github.com/llvm/llvm-project/issues/62475 \
12-
# add it twice to workaround:
13-
&& add-apt-repository --yes "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-18 main" \
14-
&& add-apt-repository --yes "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-18 main" \
15-
&& sleep 5 \
16-
&& apt update \
17-
&& apt install -y git llvm-18 clang-18 libclang-18-dev clang-18 cmake \
18-
&& rm -rf /var/lib/apt/lists/*;
19-
20-
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
21-
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
22-
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-18 100
23-
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-18 100
24-
25-
WORKDIR /usr/src
1+
FROM cubejs/rust-builder:bookworm-llvm-18 AS builder
262

273
WORKDIR /build/cubestore
284
COPY Cargo.toml .

rust/cubestore/builder.Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ARG OS_NAME=bookworm-slim
2+
3+
FROM rust:$OS_NAME
4+
5+
ARG LLVM_VERSION=18
6+
7+
RUN rustup update && \
8+
rustup default nightly-2024-01-29 && \
9+
rustup component add --toolchain nightly-2024-01-29 rustfmt clippy;
10+
11+
RUN apt update \
12+
&& apt upgrade -y \
13+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common libssl-dev pkg-config wget gnupg git apt-transport-https ca-certificates \
14+
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
15+
# https://github.com/llvm/llvm-project/issues/62475 \
16+
# add it twice to workaround:
17+
&& add-apt-repository --yes "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-$LLVM_VERSION main" \
18+
&& add-apt-repository --yes "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-$LLVM_VERSION main" \
19+
&& sleep 5 \
20+
&& apt update \
21+
&& apt install -y git llvm-$LLVM_VERSION clang-$LLVM_VERSION libclang-$LLVM_VERSION-dev clang-$LLVM_VERSION cmake \
22+
&& rm -rf /var/lib/apt/lists/*;
23+
24+
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
25+
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
26+
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-$LLVM_VERSION 100
27+
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-$LLVM_VERSION 100
28+
29+
WORKDIR /usr/src

rust/cubestore/docker-bake.hcl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
target "rust-builder-bookworm" {
2+
context = "."
3+
dockerfile = "builder.Dockerfile"
4+
args = {
5+
OS_NAME = "1-slim-bookworm"
6+
LLVM_VERSION = "18"
7+
}
8+
tags = ["cubejs/rust-builder:bookworm-llvm-18"]
9+
platforms = ["linux/amd64", "linux/arm64"]
10+
}

rust/cubestore/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
22
channel = "nightly-2024-01-29"
3-
components = ["rustfmt", "rustc-dev", "clippy"]
3+
components = ["rustfmt", "clippy"]
44
profile = "minimal"

0 commit comments

Comments
 (0)