@@ -16,63 +16,61 @@ jobs:
1616 RAILS_ENV : test
1717 DATABASE_URL : ' mysql2://127.0.0.1' # shogo82148/actions-setup-mysql@v1 doesn't work with socket
1818 steps :
19- - uses : tedconf/setup-ruby@1.0.3
19+ - uses : tedconf/setup-ruby@1.1.0
2020 with :
2121 ssh-private-key : ${{ secrets.TEDCONF_GH_ACTIONS_JENKINS_PRIV_SSH_KEY }}
2222 rubygems-key : ${{ secrets.BUNDLE_RUBYGEMS__TED__COM }}
2323 ruby-version : ${{ inputs.ruby-version }}
2424 - name : Check for coyote gem
2525 shell : bash
26- id : coyote
2726 run : |
28- echo "::set-output name=count:: $(grep coyote Gemfile.lock | wc -l)"
27+ echo "coyote_count= $(grep coyote Gemfile.lock | wc -l)" >> $GITHUB_ENV
2928 - name : Configure sysctl limits on localhost to be able to run Elasticsearch
3029 # Required to get Elasticsearch container to run on shgar host
3130 shell : bash
32- if : steps.coyote.outputs.count > 0
31+ if : env.coyote_count > 0
3332 run : |
3433 sudo swapoff -a
3534 sudo sysctl -w vm.swappiness=1
3635 sudo sysctl -w fs.file-max=262144
3736 sudo sysctl -w vm.max_map_count=262144
3837 - name : Setup and start Elasticsearch
3938 uses : tedconf/elasticsearch-github-actions@lee-self_hosted
40- if : steps.coyote.outputs.count > 0
39+ if : env.coyote_count > 0
4140 with :
4241 stack-version : 6.8.23
4342 plugins : ' analysis-icu analysis-phonetic'
4443
4544 - name : Elasticsearch is reachable
46- if : steps.coyote.outputs.count > 0
45+ if : env.coyote_count > 0
4746 run : |
4847 curl --verbose --show-error http://localhost:9200
4948 - name : Check if database is needed
50- id : db
5149 shell : bash
5250 run : |
51+ has_db_yml=0
5352 if [ -f "./config/database.yml" ]; then
54- echo ::set-output name=required::1
55- else
56- echo ::set-output name=required::0
53+ has_db_yml=1
5754 fi
55+ echo "uses_db=$has_db_yml" >> $GITHUB_ENV
5856
5957 - name : Set up test secrets
60- if : steps.db.outputs.required > 0
58+ if : env.uses_db > 0
6159 run : cp config/secrets.github.yml config/secrets.yml
6260 - name : Setup MySQL
6361 # Workaround for MySQL in ACT until
6462 # https://bugs.launchpad.net/ubuntu/focal/+source/mysql-8.0/+bug/1899248 is
6563 # released
66- if : steps.db.outputs.required > 0 && env.ACT
64+ if : env.uses_db > 0 && env.ACT
6765 uses : shogo82148/actions-setup-mysql@v1
6866 with :
6967 mysql-version : ' 8.0'
7068 root-password : root
7169 - name : Start MySQL
72- if : ${{ steps.db.outputs.required > 0 && !env.ACT }}
70+ if : ${{ env.uses_db > 0 && !env.ACT }}
7371 run : sudo /etc/init.d/mysql start
7472 - name : Create DB
75- if : steps.db.outputs.required > 0
73+ if : env.uses_db > 0
7674 env :
7775 RAILS_ENV : test
7876 run : |
8381 bundle exec rspec
8482 # prevent accidentally leaking secrets
8583 - name : Remove test secrets
86- if : steps.db.outputs.required > 0
84+ if : env.uses_db > 0
8785 run : |
8886 rm config/secrets.yml
0 commit comments