Skip to content

Commit 9c76312

Browse files
committed
Added Erlang support
Signed-off-by: sandhi <sagarwal@progress.com>
1 parent 3b59424 commit 9c76312

File tree

2 files changed

+74
-3
lines changed

2 files changed

+74
-3
lines changed

.github/workflows/ci-main-pull-request.yml

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,61 @@ jobs:
10231023
uses: actions/checkout@v6
10241024
with:
10251025
fetch-depth: 0
1026+
1027+
- name: Configure git for private Go modules
1028+
env:
1029+
GOPRIVATE: ${{ inputs.go-private-modules }}
1030+
run: git config --global url."https://${{ secrets.GH_TOKEN }}@github.com/".insteadOf "https://github.com/"
1031+
1032+
- name: Install build tools for native extensions
1033+
if: inputs.language == 'erlang'
1034+
run: |
1035+
sudo apt-get update
1036+
sudo apt-get install -y \
1037+
build-essential \
1038+
libtool \
1039+
bison \
1040+
flex \
1041+
automake \
1042+
autoconf \
1043+
libffi-dev \
1044+
libyaml-dev \
1045+
pkg-config \
1046+
libgecode-dev \
1047+
libxml-2-dev \
1048+
libxslt1-dev
1049+
1050+
- name: Set up Erlang/OTP and rebar3
1051+
if: inputs.language == 'erlang'
1052+
uses: erlef/setup-beam@v1
1053+
with:
1054+
otp-version: '25.3.2.16'
1055+
rebar3-version: '3.22.0'
1056+
1057+
- name: Set up Ruby
1058+
if: inputs.language == 'erlang' || inputs.language == 'ruby'
1059+
uses: ruby/setup-ruby@v1
1060+
with:
1061+
ruby-version: '3.4.2'
1062+
bundler-cache: true
1063+
1064+
- name: Pre-build Ruby dependencies with gecode fix
1065+
if: inputs.language == 'erlang'
1066+
run: |
1067+
if [ -d apps/chef_objects/priv/depselector_rb ]; then
1068+
cd apps/chef_objects/priv/depselector_rb
1069+
bundle config set --local path '.bundle'
1070+
1071+
# Extract gems without building
1072+
bundle install || true
1073+
1074+
# Symlink automake's config files into gecode directory (survives autoconf regeneration)
1075+
find .bundle -type d -name "gecode-*" -exec ln -sf /usr/share/automake-*/config.guess {} \; 2>/dev/null || true
1076+
find .bundle -type d -name "gecode-*" -exec ln -sf /usr/share/automake-*/config.sub {} \; 2>/dev/null || true
1077+
1078+
# Now build with symlinks in place
1079+
bundle install
1080+
fi
10261081
10271082
- name: Starting Black Duck Polaris scan
10281083
run: |
@@ -1332,7 +1387,7 @@ jobs:
13321387
name: 'Generating SBOM'
13331388
# Create software bill-of-materials (SBOM) using SPDX format
13341389
if: ${{ inputs.generate-sbom == true }}
1335-
uses: chef/common-github-actions/.github/workflows/sbom.yml@main
1390+
uses: chef/common-github-actions/.github/workflows/sbom.yml@sandhi/fix-blackduc-sca
13361391
needs: checkout # TODO: fix set-application-version
13371392
secrets: inherit
13381393
with:

.github/workflows/sbom.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,28 @@ jobs:
203203
uses: actions/checkout@v6
204204

205205
- name: Set up Ruby and run bundle install
206-
if: ${{ inputs.language == 'ruby' }} # only run for Ruby projects where we need to generate Gemfile.lock at runtime, inputs.run-bundle-install == true
206+
if: ${{ inputs.language == 'ruby' || inputs.language == 'erlang' }} # only run for Ruby projects where we need to generate Gemfile.lock at runtime, inputs.run-bundle-install == true
207207
uses: ruby/setup-ruby@v1
208208
with:
209-
ruby-version: '3.4'
209+
ruby-version: '3.4.2'
210210
bundler-cache: true
211211

212+
- name: Set up Erlang/OTP and rebar3
213+
if: inputs.language == 'erlang'
214+
uses: erlef/setup-beam@v1
215+
with:
216+
otp-version: '25.3.2.16'
217+
rebar3-version: '3.22.0'
218+
219+
- name: Verify Erlang and rebar3 installation
220+
if: inputs.language == 'erlang'
221+
run: |
222+
echo "Verifying Erlang/OTP installation..."
223+
erl -version
224+
echo "Verifying rebar3 installation..."
225+
rebar3 version
226+
which rebar3
227+
212228
- name: Configure git for private Go modules
213229
if : ${{ inputs.go-private-modules != '' }}
214230
env:

0 commit comments

Comments
 (0)