Skip to content

Commit

Permalink
Merge pull request #397 from nimblehq/release/5.4.0
Browse files Browse the repository at this point in the history
Release 5.4.0
  • Loading branch information
malparty authored Mar 24, 2023
2 parents cfb5e9a + d1d1c61 commit 49b5b24
Show file tree
Hide file tree
Showing 21 changed files with 106 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Team
# @malparty is the Team Lead and the others are team members
* @rosle @andyduong1920 @bterone @byhbt @carryall @hanam1ni @hoangmirs @junan @Lahphim @longnd @malparty @tyrro
* @rosle @andyduong1920 @bterone @byhbt @carryall @hanam1ni @hoangmirs @longnd @malparty @tyrro @sanG-github

# Engineering Leads
CODEOWNERS @nimblehq/engineering-leads
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ labels: "type : bug"
## Issue

Describe the issue you are facing. Show us the implementation: screenshots, gif, etc.

## Expected

Describe what should be the correct behaviour.

## Steps to reproduce

1.
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ labels: "type : feature"

## Why

Describe the big picture of the feature and why it's needed.
Describe the big picture of the feature and why it's needed.

## Who Benefits?

Describe who will be the beneficiaries e.g. everyone, specific chapters, clients...
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://github.com/nimblehq/rails-templates/issues/??
close #

## What happened 👀

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Variants
name: Test Generated App

on: push

Expand All @@ -15,7 +15,7 @@ env:

jobs:
test:
name: Test ${{ matrix.variant }} variant
name: ${{ matrix.variant }} variant
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -26,10 +26,10 @@ jobs:
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3

- name: Set env BRANCH_TAG
uses: nimblehq/branch-tag-action@v1.2
uses: nimblehq/branch-tag-action@1

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -38,12 +38,12 @@ jobs:
bundler-cache: true

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.4
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Cache gems
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /home/runner/.rubies/ruby-${{ env.RUBY_VERSION }}
key: ${{ runner.os }}-gems-${{ env.RUBY_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
Expand All @@ -56,11 +56,11 @@ jobs:
- name: Get yarn cache directory path
if: ${{ matrix.variant == 'web' }}
id: yarn-cache-dir-path
run: echo "::set-output name=yarn_cache_dir::$(yarn cache dir)"
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache npm packages
if: ${{ matrix.variant == 'web' }}
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.yarn_cache_dir }}
Expand All @@ -76,7 +76,7 @@ jobs:
make create_${{ matrix.variant }}
- name: Login to docker registry
uses: docker/login-action@v1.6.0
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY_HOST }}
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
Expand All @@ -100,12 +100,12 @@ jobs:
cd $APP_NAME
docker-compose push test
- name: Test template
- name: Test the structure that is generated by the template
run: |
export BRANCH_TAG=${{ env.BRANCH_TAG }}-${{ matrix.variant }}
make test_template VARIANT=${{ matrix.variant }}
- name: Test variants
- name: Test the generated app
run: |
export BRANCH_TAG=${{ env.BRANCH_TAG }}-${{ matrix.variant }}
make test_variant_app
16 changes: 8 additions & 8 deletions .github/workflows/test_production_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test production build
name: Test Production Docker Build

on: push

Expand All @@ -12,7 +12,7 @@ env:

jobs:
build_production:
name: Build docker production image for ${{ matrix.variant }} variant
name: ${{ matrix.variant }} variant
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -23,10 +23,10 @@ jobs:
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3

- name: Set env BRANCH_TAG
uses: nimblehq/branch-tag-action@v1.2
uses: nimblehq/branch-tag-action@1

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -35,12 +35,12 @@ jobs:
bundler-cache: true

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.4
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Cache gems
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /home/runner/.rubies/ruby-${{ env.RUBY_VERSION }}
key: ${{ runner.os }}-gems-${{ env.RUBY_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
Expand All @@ -53,11 +53,11 @@ jobs:
- name: Get yarn cache directory path
if: ${{ matrix.variant == 'web' }}
id: yarn-cache-dir-path
run: echo "::set-output name=yarn_cache_dir::$(yarn cache dir)"
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache npm packages
if: ${{ matrix.variant == 'web' }}
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.yarn_cache_dir }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_template.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Template
name: Test the codebase of the template

on: push

Expand All @@ -7,7 +7,7 @@ env:

jobs:
test:
name: Test template
name: Installation and linting
runs-on: ubuntu-latest

steps:
Expand All @@ -17,7 +17,7 @@ jobs:
access_token: ${{ github.token }}

- name: Checkout Repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -26,7 +26,7 @@ jobs:
bundler-cache: true

- name: Cache gems
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-template-${{ env.RUBY_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
Expand Down
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ RSpec/ContextWording:
Prefixes:
- when
- given

RSpec/NestedGroups:
Max: 5

RSpec/MultipleExpectations:
Max: 10
2 changes: 1 addition & 1 deletion .template/addons/bootstrap/package.json.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true

run 'yarn add bootstrap@5.1.3'
run 'yarn add bootstrap@5.2.3'
run 'yarn add @popperjs/[email protected]'
4 changes: 4 additions & 0 deletions .template/addons/bootstrap/stylesheets/vendor/_bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// Configuration
@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/maps';
// @import 'sass_maps'; // Optional Sass map overrides here (See: https://getbootstrap.com/docs/5.2/migration/#new-_mapsscss)
// e.g., $theme-colors: map-merge($theme-colors, $custom-theme-colors);

@import 'bootstrap/scss/mixins';
@import 'bootstrap/scss/utilities';

Expand Down
1 change: 1 addition & 0 deletions .template/addons/devise/spec_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
RSpec.configure do |config|
config.include Devise::Test::ControllerHelpers, type: :controller
config.include Devise::Test::ControllerHelpers, type: :view
config.include Devise::Test::IntegrationHelpers, type: :request
end
RUBY
2 changes: 1 addition & 1 deletion .template/addons/docker/.env.tt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ DOCKER_IMAGE=<%= DOCKER_IMAGE %>
BRANCH_TAG=latest
PORT=80
CI=false
TEST_RETRY=true
TEST_RETRY=0
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch || github.ref }}

- name: Set env BRANCH_TAG
uses: nimblehq/branch-tag-action@v1.2
uses: nimblehq/branch-tag-action@1
with:
ref: ${{ github.event.workflow_run.head_branch || github.ref }}

Expand All @@ -48,7 +48,7 @@ jobs:
fi

- name: Login to Docker registry
uses: docker/login-action@v1.6.0
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY_HOST }}
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
Expand Down
45 changes: 38 additions & 7 deletions .template/addons/github/.github/workflows/test.yml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ env:
# Set the default docker-compose file
COMPOSE_FILE: docker-compose.test.yml

# Set the default CI value despite the Github Action default value
CI: true

jobs:
build:
name: Build Docker image
Expand All @@ -31,10 +34,10 @@ jobs:
- uses: actions/checkout@v3

- name: Set env BRANCH_TAG
uses: nimblehq/branch-tag-action@v1.2
uses: nimblehq/branch-tag-action@1

- name: Login to Docker registry
uses: docker/login-action@v1.6.0
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY_HOST }}
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
Expand All @@ -50,18 +53,43 @@ jobs:
- name: Push Docker image
run: docker-compose push test

linting:
name: Linting
runs-on: ubuntu-latest
needs: build
timeout-minutes: 5
steps:
- uses: actions/checkout@v3

- name: Set env BRANCH_TAG
uses: nimblehq/[email protected]

- name: Login to Docker registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY_HOST }}
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
password: ${{ env.DOCKER_REGISTRY_TOKEN }}

- name: Pull Docker image
run: docker-compose pull test || true

- name: Run codebase test
run: docker-compose run test bundle exec rspec spec/codebase/codebase_spec.rb --format progress

unit_tests:
name: Unit tests
runs-on: ubuntu-latest
needs: build
timeout-minutes: 15
steps:
- uses: actions/checkout@v3

- name: Set env BRANCH_TAG
uses: nimblehq/branch-tag-action@v1.2
uses: nimblehq/branch-tag-action@1

- name: Login to Docker registry
uses: docker/login-action@v1.6.0
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY_HOST }}
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
Expand All @@ -71,7 +99,7 @@ jobs:
run: docker-compose pull test || true

- name: Run unit tests
run: docker-compose run test bundle exec rspec --exclude-pattern "spec/systems/**/*_spec.rb" --profile --format progress
run: docker-compose run test bundle exec rspec --exclude-pattern "spec/systems/**/*_spec.rb, spec/codebase/codebase_spec.rb" --profile --format progress

- name: Upload tests coverage artifact
uses: actions/upload-artifact@v3
Expand All @@ -83,14 +111,17 @@ jobs:
name: System tests
runs-on: ubuntu-latest
needs: build
timeout-minutes: 15
env:
TEST_RETRY: 2
steps:
- uses: actions/checkout@v3

- name: Set env BRANCH_TAG
uses: nimblehq/branch-tag-action@v1.2
uses: nimblehq/branch-tag-action@1

- name: Login to Docker registry
uses: docker/login-action@v1.6.0
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY_HOST }}
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3

- name: Set env BRANCH_TAG
uses: nimblehq/branch-tag-action@v1.2
uses: nimblehq/branch-tag-action@1

- name: Build Docker image
run: bin/docker-prepare && docker compose build
4 changes: 4 additions & 0 deletions .template/spec/base/config/environments/test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
expect(subject).to contain(bullet_config)
end

it 'eager load on CI' do
expect(subject).to contain('config.eager_load = ENV["CI"].present?')
end

private

def mailer_default_url_config
Expand Down
Loading

0 comments on commit 49b5b24

Please sign in to comment.