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 24, 2022
1 parent 39b7730 commit ce1424d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 18 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/Image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Image

on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * 5'

jobs:

BuildAndPush:
runs-on: ubuntu-latest
permissions:
packages: write
env:
IMAGE: ghcr.io/f4pga/prjxray/ci

steps:

- name: Build image prjxray/ci
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
20 changes: 2 additions & 18 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ jobs:


BuildDatabase:
container: ubuntu:bionic

runs-on: [self-hosted, Linux, X64]
container: 'ghcr.io/f4pga/prjxray/ci'

strategy:
fail-fast: false
Expand All @@ -27,13 +26,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,9 +53,8 @@ jobs:
Tests:
container: ubuntu:bionic

runs-on: [self-hosted, Linux, X64]
container: 'ghcr.io/f4pga/prjxray/ci'

env:
ALLOW_ROOT: true
Expand All @@ -74,13 +65,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 ce1424d

Please sign in to comment.