Skip to content

Commit e8aee36

Browse files
committed
Update workflow
1 parent 871c96c commit e8aee36

4 files changed

Lines changed: 33 additions & 14 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG USER=ci
44

55
RUN apt-get update && apt-get install -y --no-install-recommends \
66
ca-certificates curl git \
7-
build-essential gcc g++ \
7+
build-essential \
88
clang lld ninja-build sudo \
99
python3 python3-pip cmake \
1010
&& rm -rf /var/lib/apt/lists/*

.github/docker/gcc/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM debian:latest
2+
3+
ARG USER=ci
4+
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
ca-certificates curl git \
7+
build-essential gcc g++ \
8+
lld ninja-build sudo \
9+
python3 python3-pip cmake \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
RUN pip install conan --break-system-packages
13+
14+
RUN useradd -m ${USER} \
15+
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
16+
17+
WORKDIR /home/${USER}/workspace

.github/workflows/mainline-compile.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: Compile (${{ matrix.compiler }})
99
runs-on: ubuntu-latest
1010
container:
11-
image: ghcr.io/hypercpu-project/hypercpu-builder:latest
11+
image: ghcr.io/hypercpu-project/hypercpu-builder-${{ matrix.compiler }}:latest
1212
options: --init
1313
permissions:
1414
contents: read
@@ -27,15 +27,7 @@ jobs:
2727
fetch-depth: 0
2828

2929
- name: Install dependencies with Conan
30-
run: |
31-
if [ "${{ matrix.compiler }}" = "clang" ]; then
32-
export CC=$(which clang)
33-
export CXX=$(which clang++)
34-
else
35-
export CC=$(which gcc)
36-
export CXX=$(which g++)
37-
fi
38-
sudo -u ci env CC=$CC CXX=$CXX conan profile detect
30+
run: sudo -u ci conan profile detect
3931

4032
- name: Fix permissions
4133
run: chown -R ci:ci "$GITHUB_WORKSPACE"

.github/workflows/mainline-prepare.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,22 @@ jobs:
2424
- name: Set up Docker Buildx
2525
uses: docker/setup-buildx-action@v3
2626

27-
- name: Build and push
27+
- name: Build and push clang image
2828
uses: docker/build-push-action@v6
2929
with:
3030
context: .
31-
file: .github/Dockerfile
31+
file: .github/docker/clang/Dockerfile
3232
push: true
33-
tags: ghcr.io/hypercpu-project/hypercpu-builder:latest
33+
tags: ghcr.io/hypercpu-project/hypercpu-builder-clang:latest
34+
cache-from: type=gha
35+
cache-to: type=gha,mode=max
36+
37+
- name: Build and push gcc image
38+
uses: docker/build-push-action@v6
39+
with:
40+
context: .
41+
file: .github/docker/gcc/Dockerfile
42+
push: true
43+
tags: ghcr.io/hypercpu-project/hypercpu-builder-gcc:latest
3444
cache-from: type=gha
3545
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)