Skip to content

Commit

Permalink
ci: avoid installing dependencies in each job
Browse files Browse the repository at this point in the history
Signed-off-by: Unai Martinez-Corral <[email protected]>
  • Loading branch information
umarcor committed May 22, 2022
1 parent 9733e8a commit 30acf59
Showing 1 changed file with 42 additions and 16 deletions.
58 changes: 42 additions & 16 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,51 @@ name: Pipeline
on:
workflow_call:

env:
IMAGE: ghcr.io/f4pga/prjxray/ci

jobs:


Dependencies:
runs-on: ubuntu-latest

steps:

- run: |
docker build -t $IMAGE - <<EOF
FROM ubuntu:bionic
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
bash \
bison \
build-essential \
ca-certificates \
clang-format \
cmake \
psmisc \
colordiff \
coreutils \
git \
flex \
python3 \
python3-dev \
python3-venv \
xsltproc \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
- uses: pyTooling/Actions/with-post-step@r0
with:
main: |
echo '${{ github.token }}' | docker login ghcr.io -u gha --password-stdin
docker push $IMAGE
post: docker logout ghcr.io


BuildDatabase:
container: ubuntu:bionic
container: $IMAGE

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

Expand All @@ -27,13 +67,6 @@ jobs:
with:
submodules: recursive

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

Expand Down Expand Up @@ -61,7 +94,7 @@ jobs:
Tests:
container: ubuntu:bionic
container: $IMAGE

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

Expand All @@ -74,13 +107,6 @@ jobs:
with:
submodules: recursive

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

Expand Down

0 comments on commit 30acf59

Please sign in to comment.