diff --git a/.env.template b/.env.template index 09753f71..e69de29b 100644 --- a/.env.template +++ b/.env.template @@ -1 +0,0 @@ -MAPBOX_ACCESS_TOKEN=MAPBOX_ACCESS_TOKEN diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 849782c6..741c63e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,53 +1,51 @@ -# .github/workflows/ruby.yml -name: Ruby +name: CI on: + pull_request: push: branches: [main] - pull_request: - branches: [main] - -env: - POSTGRES_DB: postgres - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password jobs: - tests: - name: Tests + test: runs-on: ubuntu-latest services: postgres: - image: postgres:12 + image: postgres env: - POSTGRES_PASSWORD: password - ports: ['5432:5432'] - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - - name: Checkout code - uses: actions/checkout@v2 + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 - - name: Setup Ruby + steps: + - name: Install packages + run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips postgresql-client libpq-dev + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2.3 + ruby-version: .ruby-version bundler-cache: true - - name: Install dependencies - run: | - sudo apt-get update && sudo apt-get -yqq install libpq-dev - bundle install --jobs 4 --retry 3 - - name: Run Tests + - name: Run tests env: RAILS_ENV: test - PGHOST: localhost - DISABLE_SPRING: 1 - run: | - cp config/database.ci.yml config/database.yml - bundle exec rails db:schema:load - bundle exec rspec --format progress + DATABASE_URL: postgres://postgres:postgres@localhost:5432 + run: bin/rails db:setup spec + + - name: Keep screenshots from failed system tests + uses: actions/upload-artifact@v4 + if: failure() + with: + name: screenshots + path: ${{ github.workspace }}/tmp/capybara + if-no-files-found: ignore + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9915f3ca..ed96ae43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Visits page. This page will show you all your visits, calculated based on the areas you've created. You can see the date and time of the visit, the area you've visited, and the duration of the visit. - A possibility to confirm or decline a visit. When you create an area, the visit is not calculated immediately. You need to confirm or decline the visit. You can do this on the Visits page. Click on the visit, then click on the "Confirm" or "Decline" button. If you confirm the visit, it will be added to your timeline. If you decline the visit, it will be removed from your timeline. - Settings for visit calculation. You can set the minimum time spent in the area to consider it as a visit. This setting can be found in the Settings page. -- [ ] Tests - [x] Swagger doc for Areas endpoint - [ ] Atomicity for visits creation