Skip to content

Commit 30acf59

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

File tree

1 file changed

+42
-16
lines changed

1 file changed

+42
-16
lines changed

.github/workflows/Pipeline.yml

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,51 @@ name: Pipeline
33
on:
44
workflow_call:
55

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

811

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

1252
runs-on: [self-hosted, Linux, X64]
1353

@@ -27,13 +67,6 @@ jobs:
2767
with:
2868
submodules: recursive
2969

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-
3770
- name: Build
3871
run: make build --output-sync=target --warn-undefined-variables -j$(nproc)
3972

@@ -61,7 +94,7 @@ jobs:
6194
6295
6396
Tests:
64-
container: ubuntu:bionic
97+
container: $IMAGE
6598

6699
runs-on: [self-hosted, Linux, X64]
67100

@@ -74,13 +107,6 @@ jobs:
74107
with:
75108
submodules: recursive
76109

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-
84110
- name: Build
85111
run: make build --output-sync=target --warn-undefined-variables -j$(nproc)
86112

0 commit comments

Comments
 (0)