From 69972406e0a663d2cad8aa90cde3679d2b195b63 Mon Sep 17 00:00:00 2001 From: Evgenii Burmakin Date: Tue, 20 Aug 2024 22:14:29 +0200 Subject: [PATCH 01/12] Add .circleci/config.yml --- .circleci/config.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..ed55b71b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,38 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference +version: 2.1 + +# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. +# See: https://circleci.com/docs/orb-intro/ +orbs: + # See the Ruby orb documentation here: https://circleci.com/developer/orbs/orb/circleci/ruby + ruby: circleci/ruby@2.1.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs +jobs: + build: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job + docker: + # Specify the version you desire here + # See: https://circleci.com/developer/images/image/cimg/ruby + - image: cimg/ruby:3.3 + + # Add steps to the job + # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps + steps: + # Checkout the code as the first step. + - checkout + - run: + name: Which bundler? + command: bundle -v + - ruby/install-deps + +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows +workflows: + sample: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. + jobs: + - build \ No newline at end of file From 8c4b387b23b71354aef77a36fb03da977960412d Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:17:19 +0200 Subject: [PATCH 02/12] Change ruby version --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed55b71b..061abdf0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: docker: # Specify the version you desire here # See: https://circleci.com/developer/images/image/cimg/ruby - - image: cimg/ruby:3.3 + - image: cimg/ruby:3.2.3 # Add steps to the job # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps @@ -35,4 +35,4 @@ workflows: sample: # This is the name of the workflow, feel free to change it to better match your workflow. # Inside the workflow, you define the jobs you want to run. jobs: - - build \ No newline at end of file + - build From bf0315063c64ba9130dcbedacf7927569db8fffd Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:20:01 +0200 Subject: [PATCH 03/12] Add running rspec tests to the build job --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 061abdf0..c35196f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,6 +29,11 @@ jobs: command: bundle -v - ruby/install-deps + # Run RSpec tests + - run: + name: Run RSpec tests + command: bundle exec rspec + # Orchestrate jobs using workflows # See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows workflows: From 7fa6a3035d62d3a1943512e16ef31e9b93b1bb44 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:21:46 +0200 Subject: [PATCH 04/12] Add postgres service and setup database in CircleCI config --- .circleci/config.yml | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c35196f4..db8946f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,43 +1,37 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/configuration-reference version: 2.1 -# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. -# See: https://circleci.com/docs/orb-intro/ orbs: - # See the Ruby orb documentation here: https://circleci.com/developer/orbs/orb/circleci/ruby ruby: circleci/ruby@2.1.1 -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs jobs: build: - # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job docker: - # Specify the version you desire here - # See: https://circleci.com/developer/images/image/cimg/ruby - image: cimg/ruby:3.2.3 + environment: + RAILS_ENV: test + - image: circleci/postgres:14.2 + environment: + POSTGRES_USER: postgres + POSTGRES_DB: test_database - # Add steps to the job - # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps steps: - # Checkout the code as the first step. - checkout - run: - name: Which bundler? - command: bundle -v - - ruby/install-deps - - # Run RSpec tests + name: Install Bundler + command: gem install bundler + - run: + name: Bundle Install + command: bundle install --jobs=4 --retry=3 + - run: + name: Database Setup + command: | + bundle exec rails db:create + bundle exec rails db:schema:load - run: name: Run RSpec tests command: bundle exec rspec -# Orchestrate jobs using workflows -# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. + sample: jobs: - build From 3b89a9462bfa33c17e6ec3116bb2c8c687589b50 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:22:47 +0200 Subject: [PATCH 05/12] Specify circleci postgres version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db8946f3..84e6d978 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ jobs: - image: cimg/ruby:3.2.3 environment: RAILS_ENV: test - - image: circleci/postgres:14.2 + - image: circleci/postgres:14.0 environment: POSTGRES_USER: postgres POSTGRES_DB: test_database From 17d3cd3eabb7800929cbde57db7bdc17b493f0a3 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:24:17 +0200 Subject: [PATCH 06/12] Change the Postgres version to 13.3 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 84e6d978..f726ee7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ jobs: - image: cimg/ruby:3.2.3 environment: RAILS_ENV: test - - image: circleci/postgres:14.0 + - image: circleci/postgres:13.3 environment: POSTGRES_USER: postgres POSTGRES_DB: test_database From 5c8b91000ecd808fae9036ad9eaec816c3be08d7 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:25:34 +0200 Subject: [PATCH 07/12] Add POSTGRES_PASSWORD to circleci config --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f726ee7c..1caad167 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,7 @@ jobs: environment: POSTGRES_USER: postgres POSTGRES_DB: test_database + POSTGRES_PASSWORD: mysecretpassword steps: - checkout From 22dc3afaa6e8656ed82fbb3c610ae6b7f67ae002 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:28:29 +0200 Subject: [PATCH 08/12] Add redis to circleci config --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1caad167..276a07a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,7 @@ jobs: POSTGRES_USER: postgres POSTGRES_DB: test_database POSTGRES_PASSWORD: mysecretpassword + - image: redis:7.0 # Add Redis service steps: - checkout From 2cc6f5f65f9d8d7afb4271f9ac6c5a2eb466e6b5 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:31:20 +0200 Subject: [PATCH 09/12] Rename the job name from build to test and the workflow name from sample to rspec --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 276a07a8..bfba1c14 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ orbs: ruby: circleci/ruby@2.1.1 jobs: - build: + test: docker: - image: cimg/ruby:3.2.3 environment: @@ -34,6 +34,6 @@ jobs: command: bundle exec rspec workflows: - sample: + rspec: jobs: - - build + - test From bfd2ba53c32bfcc8e09ac158c8696f9a44ab6110 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:39:00 +0200 Subject: [PATCH 10/12] Update readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0fb1bf8e..2ab87610 100644 --- a/README.md +++ b/README.md @@ -50,14 +50,14 @@ To import your Google Maps Timeline data, download your location history from [G ## How-to's - [How to set up reverse proxy](docs/how_to_setup_reverse_proxy.md) -- [How to import Google Takeout to Dawarich](https://github.com/Freika/dawarich/wiki/How-to-import-your-Google-Takeout-data) -- [How to import Google Semantic History to Dawarich](https://github.com/Freika/dawarich/wiki/How-to-import-your-Google-Semantic-History-data) -- [How to import Google Maps Timeline Data to Dawarich](https://github.com/Freika/dawarich/wiki/How-to-import-your-Google-Maps-Timeline-data) -- [How to track your location to Dawarich with Overland](https://github.com/Freika/dawarich/wiki/How-to-track-your-location-to-Dawarich-with-Overland) -- [How to track your location to Dawarich with OwnTracks](https://github.com/Freika/dawarich/wiki/How-to-track-your-location-to-Dawarich-with-OwnTracks) -- [How to export your data from Dawarich](https://github.com/Freika/dawarich/wiki/How-to-export-your-data-from-Dawarich) +- [How to import Google Takeout to Dawarich](https://dawarich.app/docs/tutorials/import-existing-data#sources-of-data) +- [How to import Google Semantic History to Dawarich](https://dawarich.app/docs/tutorials/import-existing-data#semantic-location-history) +- [How to import Google Maps Timeline Data to Dawarich](https://dawarich.app/docs/tutorials/import-existing-data#recordsjson) +- [How to track your location to Dawarich with Overland](https://dawarich.app/docs/tutorials/track-your-location#overland) +- [How to track your location to Dawarich with OwnTracks](https://dawarich.app/docs/tutorials/track-your-location#owntracks) +- [How to export your data from Dawarich](https://dawarich.app/docs/tutorials/export-your-data) -More guides can be found in the [Wiki](https://github.com/Freika/dawarich/wiki#how-tos) +More guides can be found in the [Docs](https://dawarich.app/docs/intro) ## Features From 61be961a1683897359315a525d8e7a40ea3807a0 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:44:09 +0200 Subject: [PATCH 11/12] Add CircleCI badge to README.md --- .circleci/config.yml | 3 +++ Gemfile | 2 +- README.md | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bfba1c14..e452a1a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,6 +2,7 @@ version: 2.1 orbs: ruby: circleci/ruby@2.1.1 + browser-tools: circleci/browser-tools@1.2.3 jobs: test: @@ -32,6 +33,8 @@ jobs: - run: name: Run RSpec tests command: bundle exec rspec + - store_artifacts: + path: coverage workflows: rspec: diff --git a/Gemfile b/Gemfile index d72ba5b6..07848de5 100644 --- a/Gemfile +++ b/Gemfile @@ -42,7 +42,7 @@ end group :test do gem 'fakeredis' gem 'shoulda-matchers' - gem 'simplecov' + gem 'simplecov', require: false gem 'super_diff' gem 'webmock' end diff --git a/README.md b/README.md index 2ab87610..fb453117 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Discord](https://dcbadge.limes.pink/api/server/pHsBjpt5J8)](https://discord.gg/pHsBjpt5J8) | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/H2H3IDYDD) | [![Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dfreika%26type%3Dpatrons&style=for-the-badge)](https://www.patreon.com/freika) +[![CircleCI](https://circleci.com/gh/Freika/dawarich.svg?style=svg)](https://app.circleci.com/pipelines/github/Freika/dawarich) ## Screenshots From c808641d20e93cc57b9f489d9883445550818212 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 20 Aug 2024 22:56:42 +0200 Subject: [PATCH 12/12] Update readme --- .circleci/config.yml | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e452a1a9..0a645c21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: POSTGRES_USER: postgres POSTGRES_DB: test_database POSTGRES_PASSWORD: mysecretpassword - - image: redis:7.0 # Add Redis service + - image: redis:7.0 steps: - checkout diff --git a/README.md b/README.md index fb453117..7a1d1630 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Discord](https://dcbadge.limes.pink/api/server/pHsBjpt5J8)](https://discord.gg/pHsBjpt5J8) | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/H2H3IDYDD) | [![Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dfreika%26type%3Dpatrons&style=for-the-badge)](https://www.patreon.com/freika) + [![CircleCI](https://circleci.com/gh/Freika/dawarich.svg?style=svg)](https://app.circleci.com/pipelines/github/Freika/dawarich) ## Screenshots