11# .github/workflows/ci.yml
22name : CI/CD for Inline-Lua
3- # IMPORTANT:
4- # Sets default permissions to be read-only for security
3+
54permissions :
65 contents : read
76
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