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 }}
24 run: bundle exec rubocop --format fuubar
29 - name: Check out code
30 uses: actions/checkout@v4
32 uses: ruby/setup-ruby@v1
34 ruby-version: ${{ env.ruby }}
37 run: bundle exec erblint .
42 - name: Check out code
43 uses: actions/checkout@v4
45 uses: ruby/setup-ruby@v1
47 ruby-version: ${{ env.ruby }}
49 - name: Cache node modules
50 uses: actions/cache@v3
53 key: yarn-${{ env.os }}-${{ hashFiles('yarn.lock') }}
56 - name: Install node modules
57 run: bundle exec bin/yarn install
58 - name: Create dummy database configuration
59 run: cp config/example.database.yml config/database.yml
61 run: bundle exec rails eslint
66 - name: Check out code
67 uses: actions/checkout@v4
69 uses: ruby/setup-ruby@v1
71 ruby-version: ${{ env.ruby }}
74 run: bundle exec brakeman -q
78 name: Rails Annotate Models
81 - name: Check out code
82 uses: actions/checkout@v4
84 uses: ruby/setup-ruby@v1
86 ruby-version: ${{ env.ruby }}
88 - name: Setup database
90 sudo systemctl start postgresql
91 sudo -u postgres createuser -s $(id -un)
92 createdb openstreetmap
93 cp config/github.database.yml config/database.yml
94 bundle exec rails db:schema:load
95 - name: Run Annotate Models
96 run: bundle exec rails annotate_models
97 - name: Fail if model annotations are out of date
98 run: git diff --exit-code