Skip to content

Commit

Permalink
[#417] Update files by variant
Browse files Browse the repository at this point in the history
  • Loading branch information
sanG-github committed Aug 4, 2023
1 parent 186a45a commit 8e7afb8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ on:
workflows:
- Test
branches:
- master
- main
- development
- develop
types:
- completed
workflow_dispatch:
Expand Down
6 changes: 6 additions & 0 deletions .template/addons/github/.github/workflows/test.yml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ env:
DOCKER_REGISTRY_USERNAME: ${{ github.repository_owner }}
DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
DOCKER_IMAGE: ${{ github.repository }}
<%- if WEB_VARIANT -%>
NODE_VERSION: 16
<%- end -%>

# Set the default docker-compose file
COMPOSE_FILE: docker-compose.test.yml
Expand Down Expand Up @@ -106,6 +108,7 @@ jobs:
name: coverage
path: coverage

<%- if WEB_VARIANT -%>
system_tests:
name: System tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -139,6 +142,7 @@ jobs:
name: system_tests_screenshots
path: tmp/screenshots/

<%- end -%>
automated_code_review:
name: Run Danger
needs: unit_tests
Expand All @@ -164,6 +168,7 @@ jobs:
with:
bundler-cache: true

<%- if WEB_VARIANT -%>
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand All @@ -183,6 +188,7 @@ jobs:
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn

<%- end -%>
- name: Run Undercover
run: bundle exec undercover-report

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ name: Test production build
on:
push:
branches-ignore:
- master
- main
- development
- develop

env:
DOCKER_REGISTRY_HOST: ${{ secrets.DOCKER_REGISTRY_HOST }}
Expand Down
11 changes: 11 additions & 0 deletions Makefile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env/setup:
env/teardown: # this command will delete data
./bin/envteardown.sh

<%- if WEB_VARIANT -%>
install-dependencies:
bundle install
yarn install
Expand All @@ -25,3 +26,13 @@ codebase:
codebase/fix:
rubocop -a
yarn codebase:fix
<%- else -%>
install-dependencies:
bundle install

codebase:
rubocop

codebase/fix:
rubocop -a
<%- end -%>
3 changes: 3 additions & 0 deletions bin/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
copy_file 'bin/test.sh', mode: :preserve
copy_file 'bin/worker.sh', mode: :preserve
copy_file 'bin/docker-prepare', mode: :preserve

if WEB_VARIANT
copy_file 'bin/docker-assets-precompile', mode: :preserve
end
5 changes: 5 additions & 0 deletions config/application.yml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ test:
<<: *default
TEST_RETRY: "0"

<%- if WEB_VARIANT -%>
# Set environment variables required in the initializers in order to precompile the assets.
# Because it initializes the app, so all variables need to exist in the Docker build stage (used in bin/docker-assets-precompile).
docker_build:
<<: *default
SECRET_KEY_BASE: dummy_secret_key_base
<%- else -%>
docker_build:
<<: *default
<%- end -%>

0 comments on commit 8e7afb8

Please sign in to comment.