Skip to content

Commit ab046cc

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

File tree

2 files changed

+72
-3
lines changed

2 files changed

+72
-3
lines changed

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

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,59 @@ 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+
1048+
- name: Set up Erlang/OTP and rebar3
1049+
if: inputs.language == 'erlang'
1050+
uses: erlef/setup-beam@v1
1051+
with:
1052+
otp-version: '25.3.2.16'
1053+
rebar3-version: '3.22.0'
1054+
1055+
- name: Set up Ruby
1056+
if: inputs.language == 'erlang' || inputs.language == 'ruby'
1057+
uses: ruby/setup-ruby@v1
1058+
with:
1059+
ruby-version: '3.4.2'
1060+
bundler-cache: true
1061+
1062+
- name: Pre-build Ruby dependencies with gecode fix
1063+
if: inputs.language == 'erlang'
1064+
run: |
1065+
if [ -d apps/chef_objects/priv/depselector_rb ]; then
1066+
cd apps/chef_objects/priv/depselector_rb
1067+
bundle config set --local path '.bundle'
1068+
1069+
# Extract gems without building
1070+
bundle install || true
1071+
1072+
# Symlink automake's config files into gecode directory (survives autoconf regeneration)
1073+
find .bundle -type d -name "gecode-*" -exec ln -sf /usr/share/automake-*/config.guess {} \; 2>/dev/null || true
1074+
find .bundle -type d -name "gecode-*" -exec ln -sf /usr/share/automake-*/config.sub {} \; 2>/dev/null || true
1075+
1076+
# Now build with symlinks in place
1077+
bundle install
1078+
fi
10261079
10271080
- name: Starting Black Duck Polaris scan
10281081
run: |
@@ -1332,7 +1385,7 @@ jobs:
13321385
name: 'Generating SBOM'
13331386
# Create software bill-of-materials (SBOM) using SPDX format
13341387
if: ${{ inputs.generate-sbom == true }}
1335-
uses: chef/common-github-actions/.github/workflows/sbom.yml@main
1388+
uses: chef/common-github-actions/.github/workflows/sbom.yml@sandhi/fix-blackduc-sca
13361389
needs: checkout # TODO: fix set-application-version
13371390
secrets: inherit
13381391
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)