Skip to content

fix: avoid crash

fix: avoid crash #2391

Workflow file for this run

name: "CI/CD"
on: [push]
env:
RSPEC_FORMAT: "documentation"
RUBY_VERSION: 3.3.4
RAILS_ENV: test
NODE_ENV: test
NODE_VERSION: 22.16.0
AVAILABLE_LOCALES: "en,fr,ca,es"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint code
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.3.0
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: OpenSourcePolitics/lint-action@master
with:
ruby_version: ${{ env.RUBY_VERSION }}
node_version: ${{ env.NODE_VERSION }}
zeitwerk:
name: Check for Zeitwerk errors
uses: ./.github/workflows/zeitwerk.yml
build_app:
uses: ./.github/workflows/build_app.yml
secrets: inherit
name: Build test application
tests:
strategy:
fail-fast: false
matrix:
test:
- command: bundle exec parallel_test --type rspec --pattern spec/lib
name: "Lib specs"
- command: bundle exec parallel_test --type rspec --pattern spec/system --group-by filesize --only-group 1,2
name: "System specs (1/4)"
- command: bundle exec parallel_test --type rspec --pattern spec/system --group-by filesize --only-group 3,4
name: "System specs (2/4)"
- command: bundle exec parallel_test --type rspec --pattern spec/system --group-by filesize --only-group 5,6
name: "System specs (3/4)"
- command: bundle exec parallel_test --type rspec --pattern spec/system --group-by filesize --only-group 7,8
name: "System specs (4/4)"
- command: bundle exec parallel_test --type rspec --pattern spec/ --exclude-pattern 'spec/(system|lib)'
name: "Other specs"
needs: build_app
name: ${{ matrix.test.name }}
uses: ./.github/workflows/test_app.yml
secrets: inherit
with:
test_command: ${{ matrix.test.command }}
bullet_n_plus_one: false
bullet_unused_eager_loading: false
docker_build:
name: Test build docker image
needs: [lint, zeitwerk]
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:16-alpine
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: host.docker.internal
steps:
- uses: OpenSourcePolitics/build-and-test-images-action@master
with:
registry: ${{ vars.REGISTRY_ENDPOINT }}
namespace: ${{ vars.REGISTRY_NAMESPACE }}
image_name: ${{ vars.IMAGE_NAME }}
tag: ${{ github.ref }}
password: ${{ secrets.TOKEN }}
database_username: ${{ env.DATABASE_USERNAME }}
database_password: ${{ env.DATABASE_PASSWORD }}
database_host: ${{ env.DATABASE_HOST }}
push: "true"
generate_release:
name: Generate release
needs: [lint, zeitwerk, tests, docker_build]
if: "github.ref == 'refs/heads/main'"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: mathieudutour/github-tag-action@v6.1
name: Bump version and push tag
id: tag_version
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1
name: Create a GitHub release
with:
generateReleaseNotes: true
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- uses: OpenSourcePolitics/build-and-push-images-action@master
with:
registry: ${{ vars.REGISTRY_ENDPOINT }}
namespace: ${{ vars.REGISTRY_NAMESPACE }}
password: ${{ secrets.TOKEN }}
image_name: ${{ vars.IMAGE_NAME }}
tag: ${{ steps.tag_version.outputs.new_tag }}