Skip to content

Upgrade all gems.

Upgrade all gems. #654

Workflow file for this run

# Copyright 2023-2024, Pablo Fernandez
#
# This file is part of Repeater World.
#
# Repeater World is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation, either version 3 of the License.
#
# Repeater World is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along with Repeater World. If not, see
# <https://www.gnu.org/licenses/>.
name: Pull Request
on: pull_request
jobs:
test-head:
name: Test Head Branch
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgis/postgis:15-3.3
ports:
- "5001:5432"
env:
POSTGRES_USER: repeater_world
POSTGRES_PASSWORD: te6ahng1phi1uizaeGhahMof1
POSTGRES_DB: repeater_world_test
env:
RAILS_ENV: test
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Ruby and Gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Set Up Database Schema
run: bin/rails db:migrate
- name: Precompile assets
run: bundle exec rake assets:precompile
- name: Run Tests
run: bundle exec rspec
- name: Upload Coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: head-result
path: coverage/.resultset.json
if-no-files-found: error
include-hidden-files: true
test-base:
name: Test Base Branch
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgis/postgis:15-3.3
ports:
- "5001:5432"
env:
POSTGRES_USER: repeater_world
POSTGRES_PASSWORD: te6ahng1phi1uizaeGhahMof1
POSTGRES_DB: repeater_world_test
env:
RAILS_ENV: test
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
## Here we do not checkout the current branch, but we checkout the base branch.
ref: ${{ github.base_ref }}
- id: base-ref-commit
run: echo "revision=`git rev-parse HEAD`" >> $GITHUB_ENV
- name: simplecov resultset cache
id: simplecov-resultset
uses: actions/cache@v4
with:
path: coverage/.resultset.json
key: simplecov-resultset-${{ env.revision }}
- name: Install Ruby and Gems
uses: ruby/setup-ruby@v1
if: steps.simplecov-resultset.outputs.cache-hit != 'true'
with:
bundler-cache: true
- name: Set Up Database Schema
if: steps.simplecov-resultset.outputs.cache-hit != 'true'
run: bin/rails db:migrate
- name: Precompile assets
if: steps.simplecov-resultset.outputs.cache-hit != 'true'
run: bundle exec rake assets:precompile
- name: Run Tests
if: steps.simplecov-resultset.outputs.cache-hit != 'true'
run: bundle exec rspec
- name: Upload Coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: base-result
path: coverage/.resultset.json
if-no-files-found: error
include-hidden-files: true
compare-coverage:
name: Compare Coverage
runs-on: ubuntu-latest
needs: [test-head, test-base]
steps:
- name: Download Base Coverage
uses: actions/download-artifact@v4
with:
name: base-result
path: ./base-result/
- name: Download Current Coverage
uses: actions/download-artifact@v4
with:
name: head-result
path: ./head-result/
- run: find .
- uses: pupeno/[email protected]
with:
base-resultset-path: ./base-result/.resultset.json
head-resultset-path: ./head-result/.resultset.json
token: ${{ secrets.GITHUB_TOKEN }}