Skip to content

Commit 589da82

Browse files
committed
feat(ci): Add GitHub Actions and fix Perl 5.8 compatibility
1 parent 295d1f8 commit 589da82

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# .github/workflows/ci.yml
22
name: CI/CD for Inline-Lua
3-
# IMPORTANT:
4-
# Sets default permissions to be read-only for security
3+
54
permissions:
65
contents: read
76

@@ -55,9 +54,9 @@ jobs:
5554
uses: shogo82148/actions-setup-perl@v1
5655
with:
5756
perl-version: ${{ matrix.perl }}
58-
# The action should automatically select the correct distribution for each OS.
5957

6058
- name: Install system dependencies (Lua)
59+
shell: bash
6160
run: |
6261
if [ "$RUNNER_OS" == "Linux" ]; then
6362
sudo apt-get update
@@ -70,38 +69,34 @@ jobs:
7069
echo "LUA_INC_PATH=C:\Users\runneradmin\scoop\apps\lua\current\include" >> $env:GITHUB_ENV
7170
echo "PATH=C:\Users\runneradmin\scoop\apps\lua\current\bin;${env:PATH}" >> $env:GITHUB_ENV
7271
fi
73-
shell: bash
7472
7573
- name: Install Perl Dependencies
76-
run: |
77-
cpanm --notest Inline Test::Exception ExtUtils::MakeMaker
78-
79-
- name: Clean build environment
80-
run: |
81-
# Remove any cached Inline files that might cause version mismatches
82-
rm -rf _Inline blib
83-
# Clean any previous build artifacts
84-
if [ -f Makefile ]; then make clean || true; fi
85-
rm -f Makefile.old
74+
run: cpanm --notest Inline Test::Exception
8675

8776
- name: Build and Test
77+
shell: bash
8878
run: |
79+
# Build the Makefile
8980
if [ "$RUNNER_OS" == "Windows" ]; then
9081
perl Makefile.PL INC="-I$env:LUA_INC_PATH" LIBS="-L$env:LUA_LIB_PATH -llua53"
9182
else
9283
perl Makefile.PL
9384
fi
85+
86+
# Compile the module
9487
make
95-
# Clean Inline cache before testing to prevent version mismatch
88+
89+
# IMPORTANT: Clean the Inline cache before testing to prevent version mismatch errors
9690
rm -rf _Inline
91+
92+
# Run the tests
9793
make test TEST_VERBOSE=1
98-
shell: bash
9994
10095
- name: Run Author/Extended Tests
101-
if: matrix.perl >= 5.22 # NOTE: Author tests often use modern syntax
96+
if: matrix.perl >= 5.22 # Author tests often use modern syntax
10297
continue-on-error: true
10398
run: |
10499
if [ -d "xt" ]; then
105100
cpanm --notest Test::Perl::Critic Test::Pod Test::Pod::Coverage
106101
prove -lv -r xt
107-
fi
102+
fi

0 commit comments

Comments
 (0)