From ee1e834c912749e18ecb2c4ba286cb913932e321 Mon Sep 17 00:00:00 2001 From: Greg Kostin Date: Tue, 5 Dec 2023 14:26:07 -0500 Subject: [PATCH] Add standardrb to ci workflow and guard against double runs on pull request to main --- .github/workflows/ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b13a196d..01d01264 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,13 +4,14 @@ name: Continuous Integration on: workflow_dispatch: push: + pull_request: branches: - 'main' - pull_request: jobs: - ci: + if: ${{ github.event_name == 'push' || github.event.pull_request.merged == true }} + runs-on: ubuntu-latest name: ${{ matrix.suite }} - Ruby ${{ matrix.ruby }} strategy: @@ -22,13 +23,9 @@ jobs: - 'test' ruby: - '3.2.2' -# - '3.1.4' -# - '3.0.4' steps: - uses: actions/checkout@v4 - - name: Setup Database - run: docker compose up dbsetup - name: Create .env run: | @@ -38,11 +35,15 @@ jobs: - if: matrix.suite == 'app' run: | docker compose build --build-arg RUBY_VERSION=${{ matrix.ruby }} app-dev + docker compose run app-dev standardrb + docker compose up dbsetup docker compose run app-dev + - if: matrix.suite == 'client-tests' run: | docker compose build --build-arg RUBY_VERSION=${{ matrix.ruby }} client-tests docker compose run client-tests + - if: matrix.suite == 'test' run: | docker compose build --build-arg RUBY_VERSION=${{ matrix.ruby }} app apache