Skip to content

Backport 'Enforce resources being found in the organization scope' to… #1444

Backport 'Enforce resources being found in the organization scope' to…

Backport 'Enforce resources being found in the organization scope' to… #1444

name: "[CI] Elections (unit tests)"
on:
push:
branches:
- develop
- release/*
- "*-stable"
pull_request:
branches-ignore:
- "chore/l10n*"
paths:
- "*"
- ".github/**"
- "decidim-admin/**"
- "decidim-bulletin_board/**"
- "decidim-core/**"
- "decidim-dev/**"
- "decidim-elections/**"
- "decidim-forms/**"
- "decidim-proposals/**"
env:
CI: "true"
RUBY_VERSION: 3.0.2
NODE_VERSION: 16.9.1
DECIDIM_MODULE: decidim-elections
PARALLEL_TEST_PROCESSORS: 2
CODECOV_TOKEN: bc15b944-6b42-420a-b3f9-a5a8fb214326
jobs:
main:
name: Tests
runs-on: ubuntu-20.04
if: "!startsWith(github.head_ref, 'chore/l10n')"
timeout-minutes: 60
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
bulletin_board:
image: decidim/decidim-bulletin-board:0.23.0
ports: ["8000:8000"]
env:
DATABASE_URL: postgresql://postgres:postgres@postgres/bb
RAILS_ENV: test
SEED: 1
IDENTIFICATION_PRIVATE_KEY: '{"kty":"RSA","n":"zMXsZpYPKkDlSmezX898y7zNOaJ7ENIN4kj4UhQ95Vm4HlgTpIs2VMMsO0eqynMaOR_G1mXdqbpbaJtXijBe4V8323QwGm6WVAa71E7pDXa5g6-uo5f8GePitN0YER9y2yNQN4uTaNzJiWV2uLBUYfMdj3SIif31YwLULHAOj3B_oleFK8coE_Qr3NzATcYBmsqE8AR4NljxTO6KDmP1SLdf5GBOBhOAIFbnL_Kpj2xkm7MS3hjMVKpiRhqA1UgX5oKZ8ixBv46fNJF0pBsHi3fHNjK9oZzgdx_AI-YFpdE_40-8bh_g9sWzxacqOM2-MdQLHbvRPEVltO3E8tr6I5YWrylcP7l9VD8OJeqjq2qFYHnGYdmLoD2XuXmI9EuBvSb9H4-qcartxZSIQCimKib_fxZvgrG1FSRRhK6YpvIdGv4-G2zfCCRsC4XD80TYI2bf-oYCoy7eU3_eVHFMV2yg4p1Wnuw2Vgq0edPL_bKaV9JvGx7F-U5juxNN0WZR9LzbPl4ReejzN95lyHgbj0nTH_u3bSpZmgJrQF-PwdnPcG46deVjJgUeosrlC4lQxVrRz0GL58BuFunnz2uYDBDrcJCiG60EbdkAFHjOcXU4wrUWATin7je_aqdBXhSnkTafcJAMvL7Y2Ld7vDge8nLqjAVlAi5am3rN0kqKT6M","e":"AQAB","kid":"a8e86f02ca27e1861bfc49e2a9a4614ca9068f8efdb6d42d19d3aab0eb2a31be"}'
DISABLE_DATABASE_ENVIRONMENT_CHECK: 1
RAILS_SERVE_STATIC_FILES: enabled
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
RUBYOPT: "-W:no-deprecated"
ELECTIONS_BULLETIN_BOARD_SERVER: http://localhost:8000/api
steps:
- uses: actions/checkout@v2.0.0
with:
fetch-depth: 1
- uses: ./.github/actions/module-rspec
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ env.DECIDIM_MODULE }}
processor_count: ${{ env.PARALLEL_TEST_PROCESSORS }}
ruby_version: ${{ env.RUBY_VERSION }}
node_version: ${{ env.NODE_VERSION }}
- run: bundle exec rake parallel:spec['spec\/(?!system)']
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
env:
SIMPLECOV: "true"
- uses: codecov/codecov-action@v3
name: Upload coverage
with:
token: ${{ env.CODECOV_TOKEN }}
name: ${{ env.DECIDIM_MODULE }}
flags: ${{ env.DECIDIM_MODULE }}
- uses: actions/upload-artifact@v2
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore