re-enable double-click to edit #604
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rspec | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
name: RSpec | |
runs-on: ubuntu-22.04 | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y mysql-client libmysqlclient-dev wkhtmltopdf pandoc yaz libyaz-dev libmagickwand-dev libpcap-dev memcached cmake | |
- name: Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- name: Runs Elasticsearch | |
uses: elastic/elastic-github-actions/elasticsearch@master | |
with: | |
stack-version: 7.17.8 | |
security-enabled: false | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Verify MySQL connection from host | |
run: | | |
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'" | |
- name: Copy Configuration | |
run: | | |
cp ./.github/workflows/rspec_config/* ./config | |
- name: Setup DB | |
env: | |
RAILS_ENV: test | |
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} | |
run: | | |
bin/rails db:create | |
bin/rails db:migrate | |
- name: Run tests | |
env: | |
RAILS_ENV: test | |
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} | |
ELASTICSEARCH_PORT: ${{ job.services.elasticsearch.ports[9200] }} | |
run: | | |
bundle exec rspec |