Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Reuse ci workflow (#819)

Zach Gollwitzeree162bbef737
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d8275946..8e9b92bf 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,7 +1,7 @@
name: CI
on:
- pull_request:
+ workflow_call:
jobs:
scan_ruby:
@@ -59,6 +59,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
+ env:
+ DATABASE_URL: postgres://postgres:postgres@localhost:5432
+ RAILS_ENV: test
+
services:
postgres:
image: postgres
@@ -82,16 +86,19 @@ jobs:
ruby-version: .ruby-version
bundler-cache: true
- - name: Run tests and smoke test seed
- env:
- RAILS_ENV: test
- DATABASE_URL: postgres://postgres:postgres@localhost:5432
+ - name: DB setup and smoke test
run: |
bin/rails db:create
bin/rails db:schema:load
- bin/rails test
bin/rails db:seed
+ - name: Unit and integration tests
+ run: bin/rails test
+
+ - name: System tests
+ run: DISABLE_PARALLELIZATION=true bin/rails test:system
+ continue-on-error: true # TODO: Eventually we'll enforce for PRs
+
- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
new file mode 100644
index 00000000..691fdd8c
--- /dev/null
+++ b/.github/workflows/pr.yml
@@ -0,0 +1,8 @@
+name: Pull Request
+
+on:
+ pull_request:
+
+jobs:
+ ci:
+ uses: ./.github/workflows/ci.yml
\ No newline at end of file
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 6c75a127..4130eca8 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -15,56 +15,12 @@ permissions:
contents: read
jobs:
-
- test:
- name: Test
- runs-on: ubuntu-latest
- timeout-minutes: 10
-
- services:
- postgres:
- image: postgres
- env:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- ports:
- - 5432:5432
- options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
-
- steps:
- - name: Install packages
- run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libvips postgresql-client libpq-dev
-
- - 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: Run tests and smoke test seed
- env:
- RAILS_ENV: test
- DATABASE_URL: postgres://postgres:postgres@localhost:5432
- run: |
- bin/rails db:create
- bin/rails db:schema:load
- bin/rails test:all
- bin/rails db:seed
-
- - name: Keep screenshots from failed system tests
- uses: actions/upload-artifact@v4
- if: failure()
- with:
- name: screenshots
- path: ${{ github.workspace }}/tmp/screenshots
- if-no-files-found: ignore
+ ci:
+ uses: ./.github/workflows/ci.yml
build:
name: Build docker image
- needs: [ test ]
+ needs: [ ci ]
runs-on: ubuntu-latest