Skip to content

Commit

Permalink
Fix PR workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Feb 14, 2024
1 parent 51dd08e commit daf7a01
Showing 1 changed file with 3 additions and 61 deletions.
64 changes: 3 additions & 61 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,8 @@ on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
services:
memcached:
image: memcached:1.4.31
ports:
- 11211/udp
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: sashimi_test
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- 3306
redis:
image: redis:6
ports:
- 6379:6379

env:
MEMCACHE_SERVERS: "localhost:11211"
MYSQL_HOST: "127.0.0.1"
MYSQL_DATABASE: sashimi_test
MYSQL_USER: root
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
SESSION_ENCRYPTED_COOKIE_SALT: ${{ secrets.SESSION_ENCRYPTED_COOKIE_SALT }}
JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }}
JWT_PUBLIC_KEY: ${{ secrets.JWT_PUBLIC_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6.x'
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install
env:
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
cp .env.build .env
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
sudo /etc/init.d/mysql start
bundle exec rake db:setup RAILS_ENV=test
- name: Lint and Test
env:
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
MEMCACHE_SERVERS: "localhost:11211"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: 'metrics-api.stage.datacite.org'
run: |
# bundle exec rubocop
bundle exec rspec
echo $?
uses: ./.github/workflows/test.yml
secrets: inherit

0 comments on commit daf7a01

Please sign in to comment.