Skip to content

Commit e6d814a

Browse files
committed
ci: avoid installing dependencies in each job
Signed-off-by: Unai Martinez-Corral <[email protected]>
1 parent 9733e8a commit e6d814a

File tree

1 file changed

+46
-18
lines changed

1 file changed

+46
-18
lines changed

.github/workflows/Pipeline.yml

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,55 @@ name: Pipeline
33
on:
44
workflow_call:
55

6+
env:
7+
IMAGE: ghcr.io/f4pga/prjxray/ci
8+
69
jobs:
710

811

9-
BuildDatabase:
10-
container: ubuntu:bionic
12+
Dependencies:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
packages: write
16+
17+
steps:
18+
19+
- run: |
20+
docker build -t $IMAGE - <<EOF
21+
FROM ubuntu:bionic
22+
RUN apt-get update -qq \
23+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
24+
bash \
25+
bison \
26+
build-essential \
27+
ca-certificates \
28+
clang-format \
29+
cmake \
30+
psmisc \
31+
colordiff \
32+
coreutils \
33+
git \
34+
flex \
35+
python3 \
36+
python3-dev \
37+
python3-venv \
38+
xsltproc \
39+
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
40+
&& update-ca-certificates \
41+
&& rm -rf /var/lib/apt/lists/*
42+
43+
- uses: pyTooling/Actions/with-post-step@r0
44+
with:
45+
main: |
46+
echo '${{ github.token }}' | docker login ghcr.io -u gha --password-stdin
47+
docker push $IMAGE
48+
post: docker logout ghcr.io
1149

50+
51+
BuildDatabase:
52+
needs: Dependencies
1253
runs-on: [self-hosted, Linux, X64]
54+
container: $IMAGE
1355

1456
strategy:
1557
fail-fast: false
@@ -27,13 +69,6 @@ jobs:
2769
with:
2870
submodules: recursive
2971

30-
- name: Install
31-
run: |
32-
apt update
33-
apt install -y \
34-
bash bison build-essential ca-certificates clang-format cmake psmisc \
35-
colordiff coreutils git flex python3 python3-dev python3-venv xsltproc
36-
3772
- name: Build
3873
run: make build --output-sync=target --warn-undefined-variables -j$(nproc)
3974

@@ -61,9 +96,9 @@ jobs:
6196
6297
6398
Tests:
64-
container: ubuntu:bionic
65-
99+
needs: Dependencies
66100
runs-on: [self-hosted, Linux, X64]
101+
container: $IMAGE
67102

68103
env:
69104
ALLOW_ROOT: true
@@ -74,13 +109,6 @@ jobs:
74109
with:
75110
submodules: recursive
76111

77-
- name: Install
78-
run: |
79-
apt update
80-
apt install -y \
81-
bash bison build-essential ca-certificates clang-format cmake psmisc \
82-
colordiff coreutils git flex python3 python3-dev python3-venv xsltproc
83-
84112
- name: Build
85113
run: make build --output-sync=target --warn-undefined-variables -j$(nproc)
86114

0 commit comments

Comments
 (0)