Skip to content

Commit

Permalink
Ensure language versions match
Browse files Browse the repository at this point in the history
  • Loading branch information
EGiataganas committed Aug 11, 2023
1 parent 049c392 commit e73f643
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
with:
rubocop: true

language-versions:
uses: ./.github/workflows/linters.yml
with:
language-versions: true

specs:
uses: ./.github/workflows/testing.yml
strategy:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
rubocop:
type: boolean
default: false
language-versions:
type: boolean
default: false

jobs:
linters:
Expand Down Expand Up @@ -45,3 +48,26 @@ jobs:
run: |
${{ inputs.run-before-linters }}
bundle exec rubocop
- name: Ensure language versions match
if: ${{ inputs.language-versions == true }}
run: |
NODE_VERSION=$(cat .node-version)
if ! grep -q "^ARG NODE_MAJOR=$NODE_VERSION" Dockerfile; then
echo "Dockerfile has wrong node: $(grep '^ARG NODE_MAJOR' Dockerfile)" >&2
exit 1
fi
if ! grep -q "^ARG NODE_MAJOR=$NODE_VERSION" Dockerfile.production; then
echo "Dockerfile.production has wrong node: $(grep '^ARG NODE_MAJOR' Dockerfile.production)" >&2
exit 1
fi
RUBY_VERSION=$(cat .ruby-version)
if ! grep -q "^FROM ruby:$RUBY_VERSION" Dockerfile; then
echo "Dockerfile has wrong ruby: $(grep '^FROM ruby:' Dockerfile)" >&2
exit 1
fi
if ! grep -q "^ARG RUBY_VERSION=$RUBY_VERSION" Dockerfile.production; then
echo "Dockerfile.production has wrong ruby: $(grep '^ARG RUBY_VERSION' Dockerfile.production)" >&2
exit 1
fi

0 comments on commit e73f643

Please sign in to comment.