From ff40ffd9db80ab619bde7fbd556efe8e1bc0b350 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Fri, 9 Jul 2021 19:35:13 +1200 Subject: [PATCH] Cache bundler on CI using `setup-ruby` (#102) We're manually bundling, but `setup-ruby` can do it for us. This also upgrades postgresql on CI. --- .github/workflows/main.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07f798c..50db328 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,29 +13,23 @@ jobs: runs-on: ubuntu-latest env: - BUNDLE_JOBS: 4 - BUNDLE_PATH: vendor/bundle CI: true DB: ${{ matrix.database }} MYSQL_PASSWORD: root PGHOST: localhost PGUSER: postgres + PGPASSWORD: postgres RAILS_ENV: test name: ${{ matrix.ruby }} ${{ matrix.database }} steps: + - run: sudo apt-get update && sudo apt-get install libpq-dev libmysqlclient-dev libsqlite3-dev -y - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: + bundler-cache: true ruby-version: ${{ matrix.ruby }} - - run: sudo apt-get update && sudo apt-get install libpq-dev libmysqlclient-dev libsqlite3-dev -y - run: sudo systemctl start mysql.service - - id: cache-bundler - uses: actions/cache@v2 - with: - path: vendor/bundle - key: ${{ matrix.ruby }}-gem-${{ matrix.database }}-${{ hashFiles('Gemfile') }} - - run: bundle install --without development --path vendor/bundle - run: bin/rake refinery:testing:dummy_app env: PGPORT: ${{ job.services.postgres.ports[5432] }} @@ -47,6 +41,12 @@ jobs: services: postgres: - image: postgres:11.5 + image: postgres + env: + POSTGRES_PASSWORD: postgres ports: ["5432:5432"] - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5