From 4be9c6fe839e784b212530eb46adf98a0ccab390 Mon Sep 17 00:00:00 2001 From: Joonas Date: Thu, 21 Dec 2023 09:31:39 +0200 Subject: [PATCH] Update versioning, update CI --- .github/workflows/ci_iframe.yml | 23 ++++++ .github/workflows/lint.yml | 43 +++-------- .github/workflows/precompile.yml | 56 -------------- .github/workflows/tests.yml | 77 ------------------- Gemfile.lock | 4 +- app/views/decidim/iframe/iframe/show.html.erb | 2 - decidim-decidim_awesome.gemspec | 6 +- lib/decidim/iframe/component.rb | 1 - lib/decidim/iframe/version.rb | 2 +- 9 files changed, 41 insertions(+), 173 deletions(-) create mode 100644 .github/workflows/ci_iframe.yml delete mode 100644 .github/workflows/precompile.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/ci_iframe.yml b/.github/workflows/ci_iframe.yml new file mode 100644 index 0000000..213d4f8 --- /dev/null +++ b/.github/workflows/ci_iframe.yml @@ -0,0 +1,23 @@ +name: "[CI] Iframe" +on: + push: + branches: + - develop + - main + - release/* + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build_app: + name: Build test application + uses: mainio/gha-decidim-module/.github/workflows/build_app.yml@main + secrets: inherit + main: + needs: build_app + name: Tests + uses: mainio/gha-decidim-module/.github/workflows/ci_rspec.yml@main + secrets: inherit diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4e25b09..1d0d27f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,40 +1,21 @@ name: "[CI] Lint" - on: push: branches: + - develop - main + - release/* pull_request: -env: - RUBY_VERSION: 3.0.6 - NODE_VERSION: 16.9.1 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: - lint-report: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - 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: npm ci - name: Install JS deps - - - run: bundle exec rubocop -P - name: Lint Ruby files - - - run: npm run stylelint - name: Lint SCSS files - - - run: bundle exec erblint app/**/*.erb - name: Lint ERB files + lint: + name: Lint code + uses: mainio/gha-decidim-module/.github/workflows/lint.yml@main + secrets: inherit + with: + eslint: true + stylelint: true diff --git a/.github/workflows/precompile.yml b/.github/workflows/precompile.yml deleted file mode 100644 index edae4d5..0000000 --- a/.github/workflows/precompile.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: "[CI] Precompile" - -on: - push: - branches: - - main - pull_request: - -env: - RUBY_VERSION: 3.0.6 - NODE_VERSION: 16.9.1 - -jobs: - lint-report: - runs-on: ubuntu-latest - - services: - postgres: - image: postgres:11 - ports: ["5432:5432"] - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - env: - POSTGRES_PASSWORD: postgres - env: - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: postgres - DATABASE_HOST: localhost - - steps: - - uses: actions/checkout@v4 - 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 }} - - - name: Setup Test App - run: bundle exec rake test_app - - - name: Precompile - run: | - cd spec/decidim_dummy_app - bundle exec rails assets:precompile - env: - RAILS_ENV: production - SECRET_KEY_BASE: just-testing \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index dffd943..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: "[CI] Tests 0.27" - -on: - push: - branches: - - main - pull_request: - -env: - CI: 1 - SIMPLECOV: 1 - NODE_VERSION: 16.9.1 - RUBY_VERSION: 3.0.6 - BUNDLE_GEMFILE: Gemfile - -jobs: - tests-latest: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - rspec: " --exclude-pattern 'spec/system/**/*_spec.rb'" - features: enabled - - rspec: system/*_spec.rb - features: enabled - fail-fast: false - - services: - postgres: - image: postgres:11 - ports: ["5432:5432"] - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - env: - POSTGRES_PASSWORD: postgres - env: - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: postgres - DATABASE_HOST: localhost - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - 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 Test App - run: bundle exec rake test_app - - - name: General RSpec with config vars ${{ matrix.features }} - run: bundle exec rspec spec/${{ matrix.rspec }} - env: - FEATURES: ${{ matrix.features }} - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - - - uses: actions/upload-artifact@v2-preview - if: always() - with: - name: screenshots - path: ./spec/decidim_dummy_app/tmp/screenshots diff --git a/Gemfile.lock b/Gemfile.lock index ca3f760..0725919 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,8 +2,8 @@ PATH remote: . specs: decidim-iframe (0.10.2) - decidim-admin (>= 0.26.0, < 0.28) - decidim-core (>= 0.26.0, < 0.28) + decidim-admin (~> 0.27.4) + decidim-core (~> 0.27.4) deface (>= 1.5) sassc (~> 2.3) diff --git a/app/views/decidim/iframe/iframe/show.html.erb b/app/views/decidim/iframe/iframe/show.html.erb index c25a072..d48825c 100644 --- a/app/views/decidim/iframe/iframe/show.html.erb +++ b/app/views/decidim/iframe/iframe/show.html.erb @@ -1,7 +1,5 @@ <%= announcement = render(partial: "decidim/shared/component_announcement") %> -<%= stylesheet_pack_tag "decidim_iframe" %> -