Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Apr 5, 2024
1 parent fb949c0 commit a5507d2
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 7 deletions.
52 changes: 52 additions & 0 deletions .github/actions/module-rspec/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: '[CI] Module rspec'
description: 'Test module with rspec'
inputs:
name:
description: 'Module Name'
required: true
github_token:
description: 'Github token'
required: true

runs:
using: "composite"
steps:
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "dir=$(npm get cache)-${{ inputs.name }}" >> $GITHUB_OUTPUT
shell: "bash"
- uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-
- run: bundle exec rake test_app
name: Create test app
shell: "bash"
- run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
name: Create the screenshots folder
shell: "bash"
- uses: nanasess/setup-chromedriver@v2
- run: RAILS_ENV=test bundle exec rails assets:precompile
name: Precompile assets
working-directory: ./spec/decidim_dummy_app/
shell: "bash"
- run: bundle exec rspec
name: RSpec
working-directory: ${{ inputs.name }}
shell: "bash"
- uses: codecov/codecov-action@v3
- uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore
37 changes: 30 additions & 7 deletions .github/workflows/ci_iframe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,40 @@ on:
- release/*
pull_request:

env:
CI: "true"
CODECOV: "true"
DECIDIM_MODULE: decidim-module-iframe

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
runs-on: ubuntu-latest
timeout-minutes: 30
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: ./.github/actions/module-rspec
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ env.DECIDIM_MODULE }}

0 comments on commit a5507d2

Please sign in to comment.