-
Notifications
You must be signed in to change notification settings - Fork 0
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
Node20 actions don't work on CentOS 7 #2
Comments
@snps-davidla if providing your own node20 is acceptable, I would opt for this instance. Mainly because if is not supported by our official images, is very unlikely that will add support in the short and long term. I've got a straightforward solution for you that should sort out your current issues and set you up for the future. Here is a step by step:
First up, we need to whip up a custom Node.js build that'll play nice with CentOS 7. Here's a script that'll do the job: #!/bin/bash
set -e
# Update system and install dependencies
yum update -y
yum groupinstall -y "Development Tools"
yum install -y wget openssl-devel
# Download and extract Node.js source
NODE_VERSION="20.11.1" # Adjust as needed
wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz
tar xzf node-v${NODE_VERSION}.tar.gz
cd node-v${NODE_VERSION}
# Configure and build Node.js
./configure --prefix=/opt/nodejs-${NODE_VERSION}
make -j$(nproc)
make install
# Create a tarball of the built Node.js
cd /opt
tar czf nodejs-${NODE_VERSION}-centos7.tar.gz nodejs-${NODE_VERSION}
echo "Custom Node.js build complete: /opt/nodejs-${NODE_VERSION}-centos7.tar.gz"
Now, let's get this custom build working with your GitHub Actions. Here's how we'll modify the workflow: name: CI with Custom Node.js
on: [push, pull_request]
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up custom Node.js
run: |
mkdir -p $HOME/.local
tar xzf /path/to/nodejs-20.11.1-centos7.tar.gz -C $HOME/.local
echo "$HOME/.local/nodejs-20.11.1/bin" >> $GITHUB_PATH
- name: Use Node.js
run: |
node --version
npm --version
# Add your other build steps here
a) Build the custom Node.js:
b) Update your GitHub Actions workflow:
c) Test and deploy:
This solution should sort out your immediate compatibility dramas while also setting you up with a process you can adapt for future Node.js versions. It lets you keep using CentOS 7 where you need to, but gives you control over the Node.js environment in your GitHub Actions workflows. Let me know if you need more clarification. |
Any progress on this? |
actions/runner#2906
The text was updated successfully, but these errors were encountered: