@@ -13,86 +13,20 @@ jobs:
1313 matrix :
1414 os : [ubuntu-latest, macos-latest]
1515 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
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}}
3422 steps :
35- - uses : actions/checkout@v4
36- - uses : ruby/setup-ruby@v1
37- with :
38- ruby-version : ${{matrix.ruby}}
39- 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
92-
93- - name : Compile on macOS
94- if : matrix.os == 'macos-latest'
95- run : bundle exec rake compile
96-
97- - name : Run tests
98- run : bundle exec rake test
23+ - uses : actions/checkout@v4
24+ - uses : ruby/setup-ruby@v1
25+ with :
26+ ruby-version : ${{matrix.ruby}}
27+ bundler-cache : true
28+ apt-get : libsqlite3-dev
29+ - name : Compile C-extension
30+ run : bundle exec rake compile
31+ - name : Run tests
32+ run : bundle exec rake test
0 commit comments