Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: avoid installing dependencies in each job #1939

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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