name: CI on: push: branches: [ master ] pull_request: branches: [ master ] jobs: sunstone: name: Arel::Extensions Test runs-on: ubuntu-22.04 steps: - name: Install Postgresql run: | sudo pg_dropcluster 13 main && echo 'okay' sudo pg_dropcluster 14 main && echo 'okay' sudo rm -rf /etc/postgresql-common sudo apt-get -y --purge remove $(sudo apt list --installed | grep postgresql | awk '{print $1}') sudo apt-get install curl ca-certificates gnupg curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' sudo apt-get update sudo apt-get -y install postgresql-15 sudo systemctl start postgresql@15-main.service sudo systemctl status postgresql@15-main.service sudo pg_lsclusters sudo -u postgres createuser runner --superuser - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1 - uses: actions/checkout@v2 - run: bundle - run: bundle exec rake test ar-postgresql: name: ActiveRecord PostgresQL Test runs-on: ubuntu-22.04 strategy: matrix: rails: - v7.0.4 steps: - name: Install Postgresql run: | sudo pg_dropcluster 13 main && echo 'okay' sudo pg_dropcluster 14 main && echo 'okay' sudo rm -rf /etc/postgresql-common sudo apt-get -y --purge remove $(sudo apt list --installed | grep postgresql | awk '{print $1}') sudo apt-get install curl ca-certificates gnupg curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' sudo apt-get update sudo apt-get -y install postgresql-15 sudo systemctl start postgresql@15-main.service sudo systemctl status postgresql@15-main.service sudo pg_lsclusters sudo -u postgres createuser runner --superuser - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1 - uses: actions/checkout@v2 - name: Download Rails run: | git clone --branch ${{ matrix.rails }} https://github.com/rails/rails.git ~/rails pushd ~/rails cat /home/runner/work/_temp/*.sh sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb rm ~/rails/Gemfile.lock sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile cat ~/rails/Gemfile bundle update --jobs=3 --retry=3 - run: | pushd ~/rails/activerecord bundle exec rake db:postgresql:rebuild postgresql:test bundle exec rake db:postgresql:rebuild postgresql:isolated_test ar-sqlite: name: ActiveRecord SQLite Test runs-on: ubuntu-22.04 strategy: matrix: rails: - v7.0.4 steps: - uses: ruby/setup-ruby@v1 with: ruby-version: 3.0 - uses: actions/checkout@v2 - name: Download Rails run: | git clone --branch ${{ matrix.rails }} https://github.com/rails/rails.git ~/rails pushd ~/rails cat /home/runner/work/_temp/*.sh sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb rm ~/rails/Gemfile.lock sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile cat ~/rails/Gemfile bundle update --jobs=3 --retry=3 - run: | pushd ~/rails/activerecord bundle exec rake sqlite3:test rm test/db/*.sqlite3 test/fixtures/*.sqlite3 bundle exec rake sqlite3:isolated_test rm test/db/*.sqlite3 test/fixtures/*.sqlite3 bundle exec rake sqlite3_mem:test ar-mysql: name: ActiveRecord MySQL Test runs-on: ubuntu-22.04 strategy: matrix: rails: - v7.0.4 steps: - name: Install MySQL run: | sudo /etc/init.d/mysql start mysql -uroot -proot -e "CREATE USER 'rails'@'%';" mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'rails'@'%' WITH GRANT OPTION;" - uses: ruby/setup-ruby@v1 with: ruby-version: 3.0 - uses: actions/checkout@v2 - name: Download Rails run: | git clone --branch ${{ matrix.rails }} https://github.com/rails/rails.git ~/rails pushd ~/rails cat /home/runner/work/_temp/*.sh sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb rm ~/rails/Gemfile.lock sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile cat ~/rails/Gemfile bundle update --jobs=3 --retry=3 - run: | pushd ~/rails/activerecord bundle exec rake db:mysql:rebuild mysql2:test bundle exec rake db:mysql:rebuild mysql2:isolated_test