From cf3be9278dad5b4369522aa3579e21780a629b1a Mon Sep 17 00:00:00 2001 From: Emilio Date: Thu, 2 Feb 2023 21:04:27 +0000 Subject: [PATCH 1/3] add initial files --- .github/workflows/pull_requests.yml | 48 +++++++++++++++++++++++++++++ .github/workflows/push_main.yml | 24 +++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/pull_requests.yml create mode 100644 .github/workflows/push_main.yml diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml new file mode 100644 index 0000000..4fb6ce0 --- /dev/null +++ b/.github/workflows/pull_requests.yml @@ -0,0 +1,48 @@ +name: Workflow for changes in the main branch + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:9.6.2-alpine + ports: + - 5432:5432 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + # needed because the postgres container does not provide a healthcheck + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Run rubocop + run: bundle exec rubocop + + - name: Prepare database + env: + RAILS_ENV: "test" + DATABASE_URL: "postgres://postgres@localhost:5432/myinterviews_test" + RUBYOPT: "-W:no-deprecated -W:no-experimental" # Suppress Rails 6 deprecation warnings for ruby 2.7 + run: | + bundle exec rails db:schema:load --trace + bundle exec rails db:migrate + + - name: Check test factories + run: bundle exec rake factory_bot:lint + + - name: Run tests + env: + RAILS_ENV: "test" + DATABASE_URL: "postgres://postgres@localhost:5432/myinterviews_test" + RUBYOPT: "-W:no-deprecated -W:no-experimental" # Suppress Rails 6 deprecation warnings for ruby 2.7 + run: bundle exec rspec \ No newline at end of file diff --git a/.github/workflows/push_main.yml b/.github/workflows/push_main.yml new file mode 100644 index 0000000..acaf412 --- /dev/null +++ b/.github/workflows/push_main.yml @@ -0,0 +1,24 @@ +name: Workflow for pull request + +on: + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Run rubocop + run: bundle exec rubocop + + - name: Check test factories + run: bundle exec rubocop + + - name: Run tests + run: bundle exec rspec \ No newline at end of file From 0ba19d90e81cdcf6387a2f8a757bb95153deafb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADlio?= Date: Tue, 18 Apr 2023 23:16:19 +0100 Subject: [PATCH 2/3] Update github action script --- .github/workflows/pull_requests.yml | 35 ++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 4fb6ce0..620338f 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -16,33 +16,46 @@ jobs: env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres + POSTGRES_DB: myinterviews_test # needed because the postgres container does not provide a healthcheck - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: + ruby-version: 2.6.6 bundler-cache: true + - name: Install PostgreSQL dev libs + run: sudo apt-get -yqq install libpq-dev + - name: Run rubocop - run: bundle exec rubocop + run: bundle exec rubocop --parallel - - name: Prepare database + - name: Setup Database env: - RAILS_ENV: "test" - DATABASE_URL: "postgres://postgres@localhost:5432/myinterviews_test" + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: myinterviews_test + POSTGRES_HOST: localhost + RAILS_ENV: test RUBYOPT: "-W:no-deprecated -W:no-experimental" # Suppress Rails 6 deprecation warnings for ruby 2.7 - run: | - bundle exec rails db:schema:load --trace - bundle exec rails db:migrate + run: bin/rails db:create db:schema:load --trace db:migrate - name: Check test factories run: bundle exec rake factory_bot:lint - name: Run tests env: - RAILS_ENV: "test" - DATABASE_URL: "postgres://postgres@localhost:5432/myinterviews_test" + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: myinterviews_test + POSTGRES_HOST: localhost + RAILS_ENV: test RUBYOPT: "-W:no-deprecated -W:no-experimental" # Suppress Rails 6 deprecation warnings for ruby 2.7 run: bundle exec rspec \ No newline at end of file From 3159a812fc42ce4c74ab283ff18466302aa92294 Mon Sep 17 00:00:00 2001 From: Emilio Date: Sat, 22 Apr 2023 20:38:00 +0100 Subject: [PATCH 3/3] Remove deploy to heorku button and add action to build and push docker image --- .github/workflows/push_main.yml | 27 ++++++++++++++++++--------- README.md | 11 +++++------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/push_main.yml b/.github/workflows/push_main.yml index acaf412..5fac85b 100644 --- a/.github/workflows/push_main.yml +++ b/.github/workflows/push_main.yml @@ -1,7 +1,7 @@ -name: Workflow for pull request +name: Workflow for changes in the main branch on: - pull_request: + push: branches: [ main ] jobs: @@ -9,16 +9,25 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: Run rubocop - run: bundle exec rubocop + - name: Run tests + run: bundle exec rspec - - name: Check test factories - run: bundle exec rubocop + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Run tests - run: bundle exec rspec \ No newline at end of file + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: emilio2hd/myinterviews:latest + cache-from: type=registry,ref=emilio2hd/myinterviews:latest + cache-to: type=inline \ No newline at end of file diff --git a/README.md b/README.md index 15ad9b9..b28c82d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ -myinterviews +myinterviews ============= -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) [![Build Status](https://circleci.com/gh/emilio2hd/myinterviews.svg?style=shield)](https://app.circleci.com/pipelines/github/emilio2hd/myinterviews) [![codebeat badge](https://codebeat.co/badges/ef8d86f7-cf6c-4726-bd2d-4bac89cc62c1)](https://codebeat.co/projects/github-com-emilio2hd-myinterviews-master) [![Coverage Status](https://coveralls.io/repos/github/emilio2hd/myinterviews/badge.svg?branch=add-coverall)](https://coveralls.io/github/emilio2hd/myinterviews?branch=add-coverall) The goal of this app is to manage job applications, interviews, cover letters and feedbacks. - + ![Template](./docs/images/interviews.png) - + # Docker You can run the application using Docker. @@ -92,8 +91,8 @@ volumes: ``` # Email Configuration -My Interviews has support to send emails by smtp only. -:warning: Note: As of July 15, 2014, Google increased [its security measures](https://support.google.com/accounts/answer/6010255) +My Interviews has support to send emails by smtp only. +:warning: Note: As of July 15, 2014, Google increased [its security measures](https://support.google.com/accounts/answer/6010255) and now blocks attempts from apps it deems less secure. # Contributions