From b91b1f68482e89ec15e2fc3f52b3b9609a547fcc Mon Sep 17 00:00:00 2001 From: Juan Gallego IV Date: Fri, 8 Mar 2024 22:26:27 +0100 Subject: [PATCH] Refactor CI workflow --- .github/workflows/ci.yml | 86 ++++++++++------------------------------ 1 file changed, 22 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 773fcff..4ea717a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,67 +7,6 @@ on: branches: [ main ] jobs: - check-security: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true - - - name: Scan for security vulnerabilities - run: bin/check-security - - check-style: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true - - - name: Lint code for consistent style - run: bin/check-style - - check-libraries: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true - - - name: Lint code for consistent style - run: bin/check-libraries - - check-packages: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true - - - name: Prevent packages' boundaries violations - run: bin/check-packages - test: runs-on: ubuntu-latest services: @@ -92,10 +31,29 @@ jobs: ruby-version: .ruby-version bundler-cache: true + - name: Configure DB + env: + RAILS_ENV: "test" + DATABASE_URL: "postgres://postgres:postgres@localhost:5432/pictoplan_test" + run: bin/rails db:setup + + - name: Scan for security vulnerabilities + run: bin/check-security + + - name: Lint code for consistent style + run: bin/check-style + + - name: Audit dependencies + run: bin/check-libraries + + - name: Prevent packages' boundaries violations + env: + RAILS_ENV: "test" + DATABASE_URL: "postgres://postgres:postgres@localhost:5432/pictoplan_test" + run: bin/check-packages + - name: Run Tests env: RAILS_ENV: "test" DATABASE_URL: "postgres://postgres:postgres@localhost:5432/pictoplan_test" - run: | - bin/rails db:setup - bin/rails test:all + run: bin/rails test:all