Merge branch 'stable' into release-58 #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rubocop | |
on: | |
push: | |
branches: | |
- '*' | |
- '**/*' | |
concurrency: | |
group: ${{ github.ref }}-rubocop | |
cancel-in-progress: true | |
jobs: | |
rubocop: | |
name: Rubocop | |
# Containers must run in Linux based operating systems | |
runs-on: ubuntu-20.04 | |
# Docker Hub image that the job executes in | |
container: ruby:3.1.4-alpine3.18 | |
steps: | |
- id: dependencies | |
name: Set up dependencies | |
run: | | |
apk add --no-cache \ | |
nodejs yarn npm \ | |
tzdata \ | |
git \ | |
bash \ | |
freetds-dev \ | |
icu icu-dev \ | |
curl libcurl curl-dev \ | |
imagemagick \ | |
libmagic file-dev file \ | |
build-base libxml2-dev libxslt-dev postgresql-dev \ | |
libgcc libstdc++ libx11 glib libxrender libxext libintl ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-freefont \ | |
chromium nss freetype freetype-dev harfbuzz ca-certificates ttf-freefont \ | |
lftp postgresql postgis geos geos-dev \ | |
shared-mime-info | |
gem install bundler --version=2.5.7 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# ensure changed-files can read repo files from git | |
- name: Configure Git Safe Directory | |
run: git config --global --add safe.directory /__w/boston-cas/boston-cas | |
- id: gems | |
name: Install gems | |
run: | | |
bundle config set --local without 'production staging' | |
bundle install --jobs 4 --retry 3 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
- id: rubocop | |
name: Run Rubocop | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
files=`echo "${ALL_CHANGED_FILES}" | tr " " "\n" | grep "**/*.rb" | tr "\n" " ./"` | |
num=`echo $files | wc -w` | |
echo $files | |
if [ $num -gt 0 ]; then bundle exec rubocop --config ./.rubocop.yml $files; else echo "No changed ruby files"; fi |