From cf4e576ab85e80354c6f5ac40f22a92afb199bcc Mon Sep 17 00:00:00 2001 From: Joey Jiao Date: Fri, 12 Jul 2024 11:21:10 +0800 Subject: all: add npm package to syz-env act(https://github.com/nektos/act) is used to build github workflow locally. When running `act -j build` in local host, it reports: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown. Adding nodejs package can fix the build error. Updated docs with act usage too. --- Makefile | 5 ++++- docs/contributing.md | 13 +++++++++++++ tools/docker/env/Dockerfile | 3 +++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cda7859ea..b8502f2da 100644 --- a/Makefile +++ b/Makefile @@ -392,7 +392,7 @@ clean: # For a tupical Ubuntu/Debian distribution. # We use "|| true" for apt-get install because packages are all different on different distros. # Also see tools/syz-env for container approach. -install_prerequisites: +install_prerequisites: act uname -a sudo apt-get update sudo apt-get install -y -q libc6-dev-i386 linux-libc-dev \ @@ -437,3 +437,6 @@ check_diff: check_shebang: ./tools/check-shebang.sh + +act: + curl https://raw.githubusercontent.com/nektos/act/master/install.sh | bash diff --git a/docs/contributing.md b/docs/contributing.md index e4e6a2733..4d1278a1c 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -150,3 +150,16 @@ and then pull the image and retag it to the name expected by `syz-env`: docker pull docker.pkg.github.com/google/syzkaller/env docker tag docker.pkg.github.com/google/syzkaller/env gcr.io/syzkaller/env ``` + +### Using [act](https://github.com/nektos/act) +.github/workflows has more tests compared to `syz-env make presubmit`. To have the same tests as the workflow, we can run these workflow jobs locally. +``` +# install act +make act +# list all jobs +bin/act -l +# run all jobs +bin/act +# run job with name build +bin/act -j build +``` diff --git a/tools/docker/env/Dockerfile b/tools/docker/env/Dockerfile index 699923093..cde05118b 100644 --- a/tools/docker/env/Dockerfile +++ b/tools/docker/env/Dockerfile @@ -94,6 +94,9 @@ RUN cd /tmp/Python-2.7.18 && ./configure RUN cd /tmp/Python-2.7.18 && make -j2 && make altinstall RUN ln -s /usr/local/bin/python2.7 /usr/bin/python2 +# Install node to pass act jobs (https://github.com/nektos/act) +RUN apt-get install -y -q nodejs + # Install gcloud sdk for dashboard/app tests. # The newest version (as of 07/10/23) is 437, however, it seems to expect to be run with python3 # (but still requires python2). But Go's aetest package still runs dev_appserver.py with python2.7. -- cgit mrf-deployment