6 group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
7 cancel-in-progress: true
16 - name: Check out code
17 uses: actions/checkout@v4
19 uses: ruby/setup-ruby@v1
21 ruby-version: ${{ env.ruby }}
25 run: bundle exec rubocop --format fuubar
30 - name: Check out code
31 uses: actions/checkout@v4
33 uses: ruby/setup-ruby@v1
35 ruby-version: ${{ env.ruby }}
39 run: bundle exec erb_lint .
44 - name: Check out code
45 uses: actions/checkout@v4
47 uses: ruby/setup-ruby@v1
49 ruby-version: ${{ env.ruby }}
52 - name: Cache node modules
53 uses: actions/cache@v4
56 key: yarn-${{ env.os }}-${{ hashFiles('yarn.lock') }}
59 - name: Install node modules
60 run: bundle exec bin/yarn install
61 - name: Create dummy database configuration
62 run: cp config/example.database.yml config/database.yml
64 run: bundle exec rails eslint
69 - name: Check out code
70 uses: actions/checkout@v4
72 uses: ruby/setup-ruby@v1
74 ruby-version: ${{ env.ruby }}
78 run: bundle exec brakeman -q
82 name: Rails Annotate Models
85 - name: Check out code
86 uses: actions/checkout@v4
88 uses: ruby/setup-ruby@v1
90 ruby-version: ${{ env.ruby }}
93 - name: Setup database
95 sudo systemctl start postgresql
96 sudo -u postgres createuser -s $(id -un)
97 createdb openstreetmap
98 cp config/github.database.yml config/database.yml
99 bundle exec rails db:schema:load
100 - name: Run Annotate Models
101 run: bundle exec rails annotate_models
102 - name: Fail if model annotations are out of date
103 run: git diff --exit-code