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 Aug 19, 2022
1 parent e6ba750 commit c8c6f60
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 18 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/Image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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 \
libtinfo5 \
&& 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:focal

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: |
DEBIAN_FRONTEND=noninteractive apt update -qq
DEBIAN_FRONTEND=noninteractive apt install -qq -y \
bash bison build-essential ca-certificates clang-format cmake psmisc \
colordiff coreutils git flex python3 python3-dev python3-venv xsltproc libtinfo5
- 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:focal

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: |
DEBIAN_FRONTEND=noninteractive apt update -qq
DEBIAN_FRONTEND=noninteractive apt install -qq -y \
bash bison build-essential ca-certificates clang-format cmake psmisc \
colordiff coreutils git flex python3 python3-dev python3-venv xsltproc libtinfo5
- name: Build
run: make build --output-sync=target --warn-undefined-variables -j$(nproc)

Expand Down

0 comments on commit c8c6f60

Please sign in to comment.