Skip to content

Commit

Permalink
Merge branch 'main' into lamparter/fluentify/scss
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamparter authored Feb 19, 2023
2 parents 7a7573e + dcc470a commit 43f8473
Show file tree
Hide file tree
Showing 235 changed files with 5,185 additions and 1,866 deletions.
91 changes: 0 additions & 91 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,91 +110,6 @@ jobs:
name: Load database schema
- ruby/rspec-test

test-migrations:
executor:
name: default
ruby-version: '3.2'
steps:
- checkout
- install-system-dependencies
- install-ruby-dependencies:
ruby-version: '3.2'
- wait-db
- run:
command: ./bin/rails db:create
name: Create database
- run:
command: ./bin/rails db:migrate VERSION=20171010025614
name: Run migrations up to v2.0.0
- run:
command: ./bin/rails tests:migrations:populate_v2
name: Populate database with test data
- run:
command: ./bin/rails db:migrate VERSION=20180514140000
name: Run migrations up to v2.4.0
- run:
command: ./bin/rails tests:migrations:populate_v2_4
name: Populate database with test data
- run:
command: ./bin/rails db:migrate VERSION=20180707154237
name: Run migrations up to v2.4.3
- run:
command: ./bin/rails tests:migrations:populate_v2_4_3
name: Populate database with test data
- run:
command: ./bin/rails db:migrate
name: Run all remaining migrations
- run:
command: ./bin/rails tests:migrations:check_database
name: Check migration result

test-two-step-migrations:
executor:
name: default
ruby-version: '3.2'
steps:
- checkout
- install-system-dependencies
- install-ruby-dependencies:
ruby-version: '3.2'
- wait-db
- run:
command: ./bin/rails db:create
name: Create database
- run:
command: ./bin/rails db:migrate VERSION=20171010025614
name: Run migrations up to v2.0.0
- run:
command: ./bin/rails tests:migrations:populate_v2
name: Populate database with test data
- run:
command: ./bin/rails db:migrate VERSION=20180514140000
name: Run pre-deployment migrations up to v2.4.0
environment:
SKIP_POST_DEPLOYMENT_MIGRATIONS: true
- run:
command: ./bin/rails tests:migrations:populate_v2_4
name: Populate database with test data
- run:
command: ./bin/rails db:migrate VERSION=20180707154237
name: Run migrations up to v2.4.3
environment:
SKIP_POST_DEPLOYMENT_MIGRATIONS: true
- run:
command: ./bin/rails tests:migrations:populate_v2_4_3
name: Populate database with test data
- run:
command: ./bin/rails db:migrate
name: Run all remaining pre-deployment migrations
environment:
SKIP_POST_DEPLOYMENT_MIGRATIONS: true
- run:
command: ./bin/rails db:migrate
name: Run all post-deployment migrations
- run:
command: ./bin/rails tests:migrations:check_database
name: Check migration result

workflows:
version: 2
build-and-test:
Expand All @@ -211,9 +126,3 @@ workflows:
name: test-ruby<< matrix.ruby-version >>
requires:
- build
- test-migrations:
requires:
- build
- test-two-step-migrations:
requires:
- build
24 changes: 15 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@
"service": "app",
"workspaceFolder": "/mastodon",

// Set *default* container specific settings.json values on container create.
"settings": {},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"rebornix.Ruby",
"webben.browserslist"
],
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"rebornix.Ruby",
"webben.browserslist"
]
}
},

"features": {
"ghcr.io/devcontainers/features/sshd:1": {
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/test-migrations-one-step.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Test one step migrations
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:

jobs:
pre_job:
runs-on: ubuntu-latest

outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}

steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths: '["Gemfile*", ".ruby-version", "**/*.rb", ".github/workflows/test-migrations-one-step.yml"]'

test:
runs-on: ubuntu-latest
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'

services:
postgres:
image: postgres:14.5
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

redis:
image: redis:7.0
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

env:
CONTINUOUS_INTEGRATION: true
DB_HOST: localhost
DB_USER: postgres
DB_PASS: postgres
DISABLE_SIMPLECOV: true
RAILS_ENV: test
BUNDLE_CLEAN: true
BUNDLE_FROZEN: true
BUNDLE_WITHOUT: 'development production'
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3

steps:
- uses: actions/checkout@v3

- name: Install native Ruby dependencies
run: sudo apt-get install -y libicu-dev libidn11-dev

- name: Set up bundler cache
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Create database
run: './bin/rails db:create'

- name: Run migrations up to v2.0.0
run: './bin/rails db:migrate VERSION=20171010025614'

- name: Populate database with test data
run: './bin/rails tests:migrations:populate_v2'

- name: Run migrations up to v2.4.0
run: './bin/rails db:migrate VERSION=20180514140000'

- name: Populate database with test data
run: './bin/rails tests:migrations:populate_v2_4'

- name: Run migrations up to v2.4.3
run: './bin/rails db:migrate VERSION=20180707154237'

- name: Populate database with test data
run: './bin/rails tests:migrations:populate_v2_4_3'

- name: Run all remaining migrations
run: './bin/rails db:migrate'

- name: Check migration result
run: './bin/rails tests:migrations:check_database'
108 changes: 108 additions & 0 deletions .github/workflows/test-migrations-two-step.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Test two step migrations
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:

jobs:
pre_job:
runs-on: ubuntu-latest

outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}

steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths: '["Gemfile*", ".ruby-version", "**/*.rb", ".github/workflows/test-migrations-two-step.yml"]'

test:
runs-on: ubuntu-latest
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'

services:
postgres:
image: postgres:14.5
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7.0
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

env:
CONTINUOUS_INTEGRATION: true
DB_HOST: localhost
DB_USER: postgres
DB_PASS: postgres
DISABLE_SIMPLECOV: true
RAILS_ENV: test
BUNDLE_CLEAN: true
BUNDLE_FROZEN: true
BUNDLE_WITHOUT: 'development production'
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3

steps:
- uses: actions/checkout@v3

- name: Install native Ruby dependencies
run: sudo apt-get install -y libicu-dev libidn11-dev

- name: Set up bundler cache
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Create database
run: './bin/rails db:create'

- name: Run migrations up to v2.0.0
run: './bin/rails db:migrate VERSION=20171010025614'

- name: Populate database with test data
run: './bin/rails tests:migrations:populate_v2'

- name: Run pre-deployment migrations up to v2.4.0
run: './bin/rails db:migrate VERSION=20180514140000'
env:
SKIP_POST_DEPLOYMENT_MIGRATIONS: true

- name: Populate database with test data
run: './bin/rails tests:migrations:populate_v2_4'

- name: Run migrations up to v2.4.3
run: './bin/rails db:migrate VERSION=20180707154237'
env:
SKIP_POST_DEPLOYMENT_MIGRATIONS: true

- name: Populate database with test data
run: './bin/rails tests:migrations:populate_v2_4_3'

- name: Run all remaining pre-deployment migrations
run: './bin/rails db:migrate'
env:
SKIP_POST_DEPLOYMENT_MIGRATIONS: true

- name: Run all post-deployment migrations
run: './bin/rails db:migrate'

- name: Check migration result
run: './bin/rails tests:migrations:check_database'
Loading

0 comments on commit 43f8473

Please sign in to comment.