From 00daeaa82220bdd9c8c76f3938558cfafe139c27 Mon Sep 17 00:00:00 2001 From: shaojunda Date: Fri, 20 Sep 2019 17:36:04 +0800 Subject: [PATCH] chore: split more step --- .github/workflows/ruby.yml | 50 +++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 8599ce823..376b44a20 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -8,25 +8,31 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Set up Ruby 2.6.4 - run: | - sudo apt-get update - sudo apt-get install software-properties-common - sudo apt-get install -y libsodium-dev - sudo apt-add-repository -y ppa:rael-gc/rvm - sudo apt-get install libpq-dev rvm - sudo /usr/share/rvm/bin/rvm install "ruby-2.6.4" - sudo /usr/share/rvm/bin/rvm use 2.6.4 - git clone https://github.com/bitcoin-core/secp256k1.git && cd secp256k1 && ./autogen.sh && ./configure && make && ./tests && sudo make install && cd .. - sudo apt install postgresql postgresql-contrib - sudo su - postgres - psql -c 'create database "ckb_explorer_test";' -U postgres - - name: Build and test with Rake - run: | - source /usr/share/rvm/scripts/rvm - gem install bundler:2.0.1 - bundle install --jobs 4 --retry 3 - bundle exec rails db:create RAILS_ENV=test - bundle exec rails db:migrate RAILS_ENV=test - bundle exec rails test RAILS_ENV=test + - uses: actions/checkout@v1 + - name: Set up Ruby 2.6.4 + run: | + sudo apt-get update + sudo apt-get install software-properties-common + sudo apt-get install -y libsodium-dev + sudo apt-add-repository -y ppa:rael-gc/rvm + sudo apt-get install libpq-dev rvm + sudo /usr/share/rvm/bin/rvm install "ruby-2.6.4" + sudo /usr/share/rvm/bin/rvm use 2.6.4 + - name: Set up SECP256k1 + run: | + git clone https://github.com/bitcoin-core/secp256k1.git && cd secp256k1 && ./autogen.sh && ./configure && make && ./tests && sudo make install && cd .. + - name: Set up PostgreSQL + run: | + sudo apt install postgresql postgresql-contrib + sudo sed -i 's/peer/trust/gI' /etc/postgresql/10/main/pg_hba.conf + sudo sed -i 's/md5/trust/gI' /etc/postgresql/10/main/pg_hba.conf + sudo systemctl restart postgresql.service + psql -c 'create database "ckb_explorer_test";' -U postgres + - name: Build and test with Rake + run: | + source /usr/share/rvm/scripts/rvm + gem install bundler:2.0.1 + bundle install --jobs 4 --retry 3 + bundle exec rails db:create RAILS_ENV=test + bundle exec rails db:migrate RAILS_ENV=test + bundle exec rails test RAILS_ENV=test