|
| 1 | +name: Perl CI with Inline::C and OpenMP |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ${{ matrix.os }} |
| 8 | + strategy: |
| 9 | + fail-fast: false # Ensure all jobs run even if one fails |
| 10 | + matrix: |
| 11 | + os: ["ubuntu-latest", "ubuntu-22.04"] |
| 12 | + perl: ["5.40" ] #, "5.38", "5.36", "5.34", "5.32", "5.30", "5.28", "5.26", "5.24", "5.22", "5.20", "5.18", "5.16", "5.14", "5.12"] |
| 13 | + gcc: ["13", "11", "9"] # Different GCC versions to test |
| 14 | + |
| 15 | + name: Perl ${{ matrix.perl }} with GCC-${{ matrix.gcc }} on ${{ matrix.os }} |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + |
| 20 | + # Install the requested GCC version |
| 21 | + - name: Install GCC-${{ matrix.gcc }} |
| 22 | + run: | |
| 23 | + sudo apt update |
| 24 | + sudo apt install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} |
| 25 | + echo "Using GCC version:" |
| 26 | + gcc-${{ matrix.gcc }} --version |
| 27 | +
|
| 28 | + # Set the selected GCC version as default |
| 29 | + - name: Configure GCC-${{ matrix.gcc }} |
| 30 | + run: | |
| 31 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 |
| 32 | + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc }} 100 |
| 33 | + export CC=/usr/bin/gcc-${{ matrix.gcc }} |
| 34 | + export CXX=/usr/bin/g++-${{ matrix.gcc }} |
| 35 | + echo "CC=$CC" >> $GITHUB_ENV |
| 36 | + echo "CXX=$CXX" >> $GITHUB_ENV |
| 37 | +
|
| 38 | + # Install Perl with the selected GCC |
| 39 | + - name: Set up Perl |
| 40 | + uses: shogo82148/actions-setup-perl@v1 |
| 41 | + with: |
| 42 | + perl-version: ${{ matrix.perl }} |
| 43 | + distribution: "default" |
| 44 | + install-option: "-Dcc=${{ env.CC }}" |
| 45 | + |
| 46 | + - run: perl -V |
| 47 | + - run: perl -v |
| 48 | + |
| 49 | + # Install Required Perl Modules |
| 50 | + - name: Install Required Perl Modules |
| 51 | + run: | |
| 52 | + cpanm --verbose --notest Inline::C |
| 53 | + cpanm --verbose Alien::OpenMP |
0 commit comments