Skip to content

Commit f75a1ca

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

File tree

2 files changed

+52
-18
lines changed

2 files changed

+52
-18
lines changed

.github/workflows/Image.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Image
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 0 * * 5'
8+
9+
jobs:
10+
11+
BuildAndPush:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
packages: write
15+
env:
16+
IMAGE: ghcr.io/f4pga/prjxray/ci
17+
18+
steps:
19+
20+
- name: Build image prjxray/ci
21+
run: |
22+
docker build -t $IMAGE - <<EOF
23+
FROM ubuntu:bionic
24+
RUN apt-get update -qq \
25+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
26+
bash \
27+
bison \
28+
build-essential \
29+
ca-certificates \
30+
clang-format \
31+
cmake \
32+
psmisc \
33+
colordiff \
34+
coreutils \
35+
git \
36+
flex \
37+
python3 \
38+
python3-dev \
39+
python3-venv \
40+
xsltproc \
41+
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
42+
&& update-ca-certificates \
43+
&& rm -rf /var/lib/apt/lists/*
44+
45+
- uses: pyTooling/Actions/with-post-step@r0
46+
with:
47+
main: |
48+
echo '${{ github.token }}' | docker login ghcr.io -u gha --password-stdin
49+
docker push $IMAGE
50+
post: docker logout ghcr.io

.github/workflows/Pipeline.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ jobs:
77

88

99
BuildDatabase:
10-
container: ubuntu:bionic
11-
1210
runs-on: [self-hosted, Linux, X64]
11+
container: 'ghcr.io/f4pga/prjxray/ci'
1312

1413
strategy:
1514
fail-fast: false
@@ -27,13 +26,6 @@ jobs:
2726
with:
2827
submodules: recursive
2928

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

@@ -61,9 +53,8 @@ jobs:
6153
6254
6355
Tests:
64-
container: ubuntu:bionic
65-
6656
runs-on: [self-hosted, Linux, X64]
57+
container: 'ghcr.io/f4pga/prjxray/ci'
6758

6859
env:
6960
ALLOW_ROOT: true
@@ -74,13 +65,6 @@ jobs:
7465
with:
7566
submodules: recursive
7667

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

0 commit comments

Comments
 (0)