diff --git a/.github/workflows/decidim_ci.yml b/.github/workflows/decidim_ci.yml index 97aee4e..1aa860b 100644 --- a/.github/workflows/decidim_ci.yml +++ b/.github/workflows/decidim_ci.yml @@ -1,8 +1,13 @@ name: "[CI] Decidim" -on: [push] +on: + push: + branches: + - main + pull_request: env: RUBY_VERSION: 3.0.6 + NODE_VERSION: 16.19.1 jobs: tests: @@ -32,14 +37,18 @@ jobs: with: fetch-depth: 1 - - uses: nanasess/setup-chromedriver@v2 - with: - chromedriver-version: 119.0.6045.105 - - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + + - uses: nanasess/setup-chromedriver@v2 + with: + chromedriver-version: 119.0.6045.105 + + - uses: actions/setup-node@master + with: + node-version: ${{ env.NODE_VERSION }} - name: Setup & create Database run: | @@ -50,7 +59,9 @@ jobs: DATABASE_PASSWORD: postgres - name: Precompile assets - run: bundle exec rake assets:precompile + run: | + npm ci + bundle exec rake assets:precompile env: RAILS_ENV: test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7107a88 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,35 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + +env: + RUBY_VERSION: 3.0.6 + NODE_VERSION: 16.19.1 + +jobs: + lint: + name: Lint code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.0.0 + with: + fetch-depth: 1 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - uses: actions/setup-node@master + with: + node-version: ${{ env.NODE_VERSION }} + + - run: bundle exec rubocop -P + name: Lint Ruby files + + - run: bundle exec mdl *.md + name: Lint Markdown files \ No newline at end of file