11name : Tests (extralite)
22
3- on : [push, pull_request]
3+ on : [ push, pull_request ]
44
55concurrency :
66 group : tests-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}
@@ -11,87 +11,28 @@ jobs:
1111 strategy :
1212 fail-fast : false
1313 matrix :
14- os : [ubuntu-latest, macos-latest]
15- ruby : ['3.2', '3.3', '3.4', 'head']
16- gcc : [13, 14, 15, null]
17- exclude :
18- # No GCC versions for macOS
19- - os : macos-latest
20- gcc : 13
21- - os : macos-latest
22- gcc : 14
23- - os : macos-latest
24- gcc : 15
25- # No null GCC for Ubuntu
26- - os : ubuntu-latest
27- gcc : null
14+ os : [ ubuntu-latest, macos-latest ]
15+ ruby : [ '3.2', '3.3', '3.4', 'head' ]
2816
29- name : ${{matrix.os}}, Ruby ${{matrix.ruby}}${{ matrix.gcc && format(' (GCC {0})', matrix.gcc) || '' }}
17+ name : ${{matrix.os}}, ${{matrix.ruby}}
3018
3119 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
3220
3321 runs-on : ${{matrix.os}}
22+
3423 steps :
3524 - uses : actions/checkout@v4
25+
26+ - name : Install packages
27+ if : matrix.os == 'ubuntu-latest'
28+ run : sudo apt-get install -y libsqlite3-dev
29+
3630 - uses : ruby/setup-ruby@v1
3731 with :
3832 ruby-version : ${{matrix.ruby}}
3933 bundler-cache : true
40- apt-get : libsqlite3-dev
41-
42- - name : Install GCC 13/14
43- if : matrix.os == 'ubuntu-latest' && (matrix.gcc == '13' || matrix.gcc == '14')
44- run : |
45- sudo apt-get update
46- sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
47- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100
48- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc }} 100
49- gcc --version
50-
51- - name : Compile with GCC 15 using cplusplus-ci
52- if : matrix.os == 'ubuntu-latest' && matrix.gcc == '15'
53- run : |
54- # Pull the pre-built GCC 15 image
55- docker pull gcc:15
56-
57- # Find Ruby and gem paths
58- RUBY_PATH=$(dirname $(which ruby))
59- GEM_PATH=$(dirname $(which gem))
60- BUNDLE_PATH=$(dirname $(which bundle))
61-
62- # Get Ruby lib directories
63- RUBY_LIB=$(ruby -e 'puts RbConfig::CONFIG["libdir"]')
64- RUBY_INCLUDE=$(ruby -e 'puts RbConfig::CONFIG["rubyhdrdir"]')
65- RUBY_ARCH_INCLUDE=$(ruby -e 'puts RbConfig::CONFIG["rubyarchhdrdir"]')
66-
67- # Install required libraries in the container
68- docker run --rm gcc:15 apt-get update
69- docker run --rm gcc:15 apt-get install -y libsqlite3-dev
70-
71- # Compile the extension inside the container with GCC 15
72- # Mount Ruby binaries, libraries, and include files
73- docker run --rm \
74- -v $PWD:/app \
75- -v $RUBY_PATH:$RUBY_PATH \
76- -v $GEM_PATH:$GEM_PATH \
77- -v $BUNDLE_PATH:$BUNDLE_PATH \
78- -v $RUBY_LIB:$RUBY_LIB \
79- -v $RUBY_INCLUDE:$RUBY_INCLUDE \
80- -v $RUBY_ARCH_INCLUDE:$RUBY_ARCH_INCLUDE \
81- -e PATH=$PATH:$RUBY_PATH:$GEM_PATH:$BUNDLE_PATH \
82- -e CC=gcc \
83- -e RUBY_LIB=$RUBY_LIB \
84- -e RUBY_INCLUDE=$RUBY_INCLUDE \
85- -e RUBY_ARCH_INCLUDE=$RUBY_ARCH_INCLUDE \
86- -w /app \
87- gcc:15 bash -c "bundle exec rake compile"
88-
89- - name : Compile on Ubuntu (non-GCC 15)
90- if : matrix.os == 'ubuntu-latest' && matrix.gcc != '15'
91- run : CC=gcc-${{ matrix.gcc }} bundle exec rake compile
9234
93- - name : Compile on macOS
94- if : matrix.os == 'macos-latest'
35+ - name : Compile C-extension
9536 run : bundle exec rake compile
9637
9738 - name : Run tests
0 commit comments