From 6b18012d192f64c1b60b7a4d18565d1d8fb3f81b Mon Sep 17 00:00:00 2001 From: Jaigouk Kim Date: Mon, 10 Apr 2023 18:51:56 +0200 Subject: [PATCH] add pg in CI --- .github/workflows/main.yml | 56 ++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbba7ec..a8d392b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,39 +19,41 @@ jobs: - '3.2' - '3.1' - '3.0' + + env: + DATABASE_URL: postgres://postgres:password@localhost:5432/neighbor_test + steps: - - uses: actions/checkout@v3 - - name: Set up Ruby ${{ matrix.ruby-version }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true - - name: postgres - uses: ankane/setup-postgres@v1 - with: - database: neighbor_test - - run: bundle exec rspec - env: - DATABASE_URL: postgres://postgres:postgres@localhost:5432/neighbor_test - - name: setup pgvector - run: | - sudo apt-get update && sudo apt-get install postgresql-server-dev-14 + - uses: actions/checkout@v3 + - name: Set up Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: postgres + uses: ankane/setup-postgres@v1 + with: + database: neighbor_test + - run: bundle install --jobs 4 --retry 3 + - run: bundle exec rspec + - name: setup pgvector + run: | + sudo apt-get update && sudo apt-get install -y postgresql-server-dev-14 git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git cd pgvector make sudo make install - - run: EXT=vector bundle exec rspec - env: - DATABASE_URL: postgres://postgres:postgres@localhost:5432/neighbor_test + - run: EXT=vector bundle exec rspec rubocop: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0' - bundler-cache: true - - name: Run RuboCop - run: bundle exec rubocop + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + bundler-cache: true + - run: bundle install --jobs 4 --retry 3 + - name: Run RuboCop + run: bundle exec rubocop