diff --git a/.env.swp b/.env.swp new file mode 100644 index 0000000000..12f19857d4 Binary files /dev/null and b/.env.swp differ diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000..3d4e1a6b21 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,77 @@ +name: Build and Deploy +concurrency: build_and_deploy_${{ github.ref_name }} + +on: push + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + tests: [rubocop, erblint, prettier] + include: + - tests: rubocop + command: bundle exec rubocop + - tests: erblint + command: bundle exec erblint app + - tests: prettier + command: yarn prettier + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2.2 + bundler-cache: true + - name: Install dependencies + run: | + sudo apt-get update && sudo apt-get -yqq install libpq-dev + bundle install --jobs 4 --retry 3 + bundle exec rails assets:precompile + - name: ${{ matrix.tests }} + run: ${{ env.COMMAND }} + env: + COMMAND: ${{ matrix.command }} + + test: + name: Test + runs-on: ubuntu-latest + services: + postgres: + image: postgres:13.5 + env: + POSTGRES_PASSWORD: password + ports: ['5432:5432'] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + strategy: + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2.2 + bundler-cache: true + + - name: Install dependencies + run: | + sudo apt-get update && sudo apt-get -yqq install libpq-dev + bundle install --jobs 4 --retry 3 + bundle exec rails assets:precompile + - name: Run Tests + env: + RAILS_ENV: test + PGHOST: localhost + DISABLE_SPRING: 1 + run: | + bundle exec rails db:schema:load + bundle exec rspec --format progress \ No newline at end of file diff --git a/Gemfile b/Gemfile index 5832657629..a6f5573b5c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" git_source(:github) { |_repo| "https://github.com/#{repo}.git" } -ruby "3.2.2" +ruby "3.2.0" # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' gem "rails", "~> 7.1.2" diff --git a/Gemfile.lock b/Gemfile.lock index b5dc64daec..5586729e38 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -521,7 +521,7 @@ DEPENDENCIES web-console RUBY VERSION - ruby 3.2.2p53 + ruby 3.2.0p0 BUNDLED WITH 2.4.22