Skip to content

Commit

Permalink
[CI] action to verify schema.rb integrity, [CI] Support for node 10 a…
Browse files Browse the repository at this point in the history
…nd 14 builds

addresses: 

#660

#640

Co-authored-by: Mushfiq Rahman <mushfiqurrahman78@yahoo.com>
Co-authored-by: Prashant <alish.khadka@gmail.com>
Co-authored-by: Shashike Jayatunge <35935196+donrestarone@users.noreply.github.com>
Co-authored-by: Pralish Kayastha <50227291+Pralish@users.noreply.github.com>
  • Loading branch information
4 people committed Jun 13, 2022
1 parent 184c412 commit ef9ff73
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/ruby.yml
Expand Up @@ -28,6 +28,9 @@ jobs:
image: redis:4.0-alpine
ports:
- 6379:6379
strategy:
matrix:
node_version: [14.x, 10.x]
steps:
- name: Configure sysctl limits
run: |
Expand All @@ -49,11 +52,25 @@ jobs:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: ${{ matrix.node_version }}
- name: Fetch schema file before running migration
run: |
tmpfile=$(mktemp)
cp ./db/schema.rb tmpfile
- name: Setup main DB
run: |
bin/rails db:create
bin/rails db:migrate
- name: Comparing schema.rb to db/migrations
run: |
if ! diff -q tmpfile ./db/schema.rb &>/dev/null; then
rm tmpfile
>&2 echo "Migration changes have not been committed."
# Exits the github workflow
exit 1
fi
rm tmpfile
echo "Migrations have been committed."
- name: compile assets/javascript
run: |
yarn install
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -25,7 +25,8 @@
},
"cacheDirectories": ["client/node_modules","node_modules"],
"engines": {
"node": "14.19.x || 10.19.x",
"yarn": "1.22.x"
"node": "14.x || 10.x",
"yarn": "1.22.x",
"npm": "6.14.x"
}
}
5 changes: 5 additions & 0 deletions test/models/subdomain_test.rb
Expand Up @@ -6,6 +6,11 @@ class SubdomainTest < ActiveSupport::TestCase
@subdomain = subdomains(:public)
end

test "can be created" do
subdomain = Subdomain.new(name: "test")
assert subdomain.save
end

test "uniqness" do
duplicate = Subdomain.new(
name: @subdomain.name
Expand Down

0 comments on commit ef9ff73

Please sign in to comment.