nimblehq / rails-templates

Our optimized Rails templates used in our projects

Home Page:https://nimblehq.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Revise the config to generate the project for `--api` accordingly

hoangnguyen92dn opened this issue Β· comments

commented

Why

There is a similar issue (#107) logged for long time ago.

I had to remove unnecessary files mostly for the UI part since generating an API project from rails-templates; in order to make the novice developers happy 🀟 and ready for development πŸ§‘β€πŸ’» πŸ‘©β€πŸ’» We would need to handle:

  • Because the API application doesn't add UI tests so we could remove steps/actions from workflows/test.yml:
    • System tests

system_tests:
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@1
- 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 system tests
run: docker-compose run test bundle exec rspec spec/systems --profile --format progress
- name: Upload system tests screenshots artifact
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: system_tests_screenshots
path: tmp/screenshots/

  • Setup Node

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Cache Node modules
id: node-modules-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-nodemodules-
- name: Yarn install
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn

  • Get rid of yarn commands in Makefile:

install-dependencies:
bundle install
yarn install
codebase:
rubocop
yarn codebase
codebase/fix:
rubocop -a
yarn codebase:fix

  • Update the branches in workflows, the default branches don't match the convention the team is following.

branches-ignore:
- master
- main
- development

branches:
- master
- main
- development

Who Benefits?

Developers