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

Scripts to enable local build from github actions workflow using nektos/act #762

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SamuelBayliss
Copy link
Collaborator

These script enable a containerized build locally using nektos/act. If these are widely adopted we can have many people able to replicate the CI flow exactly in their local machine ( with an environment controlled using the same mechanisms as the CI).

These scripts contain some additions to make this go fast.

  • CCache usage backed by a persistent container
  • Worktree checkout enabled by a bind-mount of LLVM
  • Substitution of local pre-built development container, rather than fetching packages on each build.

@makslevental
Copy link
Collaborator

My 2cents: the solution to mismatch between CI and local is not to make local more like CI but to make CI more like local. Going down the act road leads to you inevitably trying discern the differences between that environment and GHAs when act breaks.

Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite useful!
Probably we should also run this from... GitHub CI :-) to check it gives consistent results.

@@ -0,0 +1,6 @@
FROM ubuntu:20.04
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any motivated reason not to go directly to 22.04 instead of adding 2 more years of technical debt ?

ENV TZ=Etc/UTC
RUN apt-get -qq update && \
apt-get -qq install -y git nodejs pip ninja-build clang lld zstd && \
pip install cmake numpy psutil pybind11 rich
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing EOL.

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN apt-get -qq update && \
apt-get -qq install -y git nodejs pip ninja-build clang lld zstd && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good opportunity to sort the package list.


# make a temporary file and fix up the Build and Test

# the local container if it doesn't exist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the feeling that the 3 comments around are out of context, even if I love comments in projects. :-)

@@ -0,0 +1,62 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

LOCAL_LLVM_REPO:=$(realpath ${ROOT_DIR}/../../)/llvm-central-repo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LOCAL_LLVM_REPO:=$(realpath ${ROOT_DIR}/../../)/llvm-central-repo
LOCAL_LLVM_REPO:=$(realpath ${ROOT_DIR}/../..)/llvm-central-repo

Comment on lines +7 to +9
-v ${GITHUB_WORKSPACE}:${WORKSPACE} \
amd/acdcbuild:1.1 \
bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-v ${GITHUB_WORKSPACE}:${WORKSPACE} \
amd/acdcbuild:1.1 \
bash
-v ${GITHUB_WORKSPACE}:${WORKSPACE} \
amd/acdcbuild:1.1 \
bash

@@ -0,0 +1,3 @@
#!/bin/bash

docker build -t amd/acdcbuild:1.1 .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing EOL.


# Dependencies

Docker ( configured with unprivileged access using 'docker' group)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to have a space after all these (?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants