Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TomCasavant committed Aug 27, 2024
2 parents 1ba5b7b + 922041c commit 96d9f4a
Show file tree
Hide file tree
Showing 1,078 changed files with 29,250 additions and 12,980 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/codespaces/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},

"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postCreateCommand": "bin/setup",
"postCreateCommand": "COREPACK_ENABLE_DOWNLOAD_PROMPT=0 bin/setup",
"waitFor": "postCreateCommand",

"customizations": {
Expand Down
6 changes: 3 additions & 3 deletions .env.production.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is a sample configuration file. You can generate your configuration
# with the `rake mastodon:setup` interactive setup wizard, but to customize
# with the `bundle exec rails mastodon:setup` interactive setup wizard, but to customize
# your setup even further, you'll need to edit it manually. This sample does
# not demonstrate all available configuration options. Please look at
# https://docs.joinmastodon.org/admin/config/ for the full documentation.
Expand Down Expand Up @@ -68,15 +68,15 @@ DB_PORT=5432

# Secrets
# -------
# Generate each with the `RAILS_ENV=production bundle exec rake secret` task (`docker-compose run --rm web bundle exec rake secret` if you use docker compose)
# Generate each with the `RAILS_ENV=production bundle exec rails secret` task (`docker-compose run --rm web bundle exec rails secret` if you use docker compose)
# -------
SECRET_KEY_BASE=
OTP_SECRET=


# Web Push
# --------
# Generate with `rake mastodon:webpush:generate_vapid_key` (first is the private key, second is the public one)
# Generate with `bundle exec rails mastodon:webpush:generate_vapid_key` (first is the private key, second is the public one)
# You should only generate this once per instance. If you later decide to change it, all push subscription will
# be invalidated, requiring the users to access the website again to resubscribe.
# --------
Expand Down
15 changes: 7 additions & 8 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
},
{
// Update devDependencies every week, with one grouped PR
matchManagers: ['npm'],
matchDepTypes: 'devDependencies',
matchUpdateTypes: ['patch', 'minor'],
groupName: 'devDependencies (non-major)',
Expand All @@ -95,8 +96,7 @@
{
// Group all eslint-related packages with `eslint` in the same PR
matchManagers: ['npm'],
matchPackageNames: ['eslint'],
matchPackagePrefixes: ['eslint-', '@typescript-eslint/'],
matchPackageNames: ['eslint', 'eslint-*', '@typescript-eslint/*'],
matchUpdateTypes: ['patch', 'minor'],
groupName: 'eslint (non-major)',
},
Expand All @@ -112,7 +112,8 @@
},
{
// Update @types/* packages every week, with one grouped PR
matchPackagePrefixes: '@types/',
matchManagers: ['npm'],
matchPackageNames: '@types/*',
matchUpdateTypes: ['patch', 'minor'],
groupName: 'DefinitelyTyped types (non-major)',
extends: ['schedule:weekly'],
Expand All @@ -129,23 +130,21 @@
{
// Group all RuboCop packages with `rubocop` in the same PR
matchManagers: ['bundler'],
matchPackageNames: ['rubocop'],
matchPackagePrefixes: ['rubocop-'],
matchPackageNames: ['rubocop', 'rubocop-*'],
matchUpdateTypes: ['patch', 'minor'],
groupName: 'RuboCop (non-major)',
},
{
// Group all RSpec packages with `rspec` in the same PR
matchManagers: ['bundler'],
matchPackageNames: ['rspec'],
matchPackagePrefixes: ['rspec-'],
matchPackageNames: ['rspec', 'rspec-*'],
matchUpdateTypes: ['patch', 'minor'],
groupName: 'RSpec (non-major)',
},
{
// Group all opentelemetry-ruby packages in the same PR
matchManagers: ['bundler'],
matchPackagePrefixes: ['opentelemetry-'],
matchPackageNames: ['opentelemetry-*'],
matchUpdateTypes: ['patch', 'minor'],
groupName: 'opentelemetry-ruby (non-major)',
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
tags: ${{ inputs.tags }}
labels: ${{ inputs.labels }}

- uses: docker/build-push-action@v5
- uses: docker/build-push-action@v6
with:
context: .
file: ${{ inputs.file_to_build }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
labels: |
org.opencontainers.image.description=Nightly build image used for testing purposes
flavor: |
latest=true
latest=auto
tags: |
type=raw,value=edge
type=raw,value=nightly
Expand All @@ -56,7 +56,7 @@ jobs:
labels: |
org.opencontainers.image.description=Nightly build image used for testing purposes
flavor: |
latest=true
latest=auto
tags: |
type=raw,value=edge
type=raw,value=nightly
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/bundler-audit.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Bundler Audit
on:
merge_group:
push:
branches-ignore:
- 'dependabot/**'
branches:
- 'main'
- 'stable-*'
paths:
- 'Gemfile*'
- '.ruby-version'
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/check-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Check i18n

on:
push:
branches: [main]
branches:
- 'main'
- 'stable-*'
pull_request:
branches: [main]
branches:
- 'main'
- 'stable-*'

env:
RAILS_ENV: test
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: 'CodeQL'

on:
merge_group:
push:
branches: ['main']
branches:
- 'main'
- 'stable-*'
pull_request:
# The branches below must be a subset of the branches above
branches: ['main']
branches:
- 'main'
- 'stable-*'
schedule:
- cron: '22 6 * * 1'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# Download the translation files from Crowdin
- name: crowdin action
uses: crowdin/github-action@v1
uses: crowdin/github-action@v2
with:
config: crowdin-glitch.yml
upload_sources: false
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/crowdin-upload.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Crowdin / Upload translations

on:
merge_group:
push:
branches:
- main
- 'main'
- 'stable-*'
paths:
- crowdin-glitch.yml
- app/javascript/flavours/glitch/locales/en.json
Expand All @@ -17,13 +19,14 @@ on:
jobs:
upload-translations:
runs-on: ubuntu-latest
if: github.repository == 'mastodon/mastodon'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v1
uses: crowdin/github-action@v2
with:
config: crowdin-glitch.yml
upload_sources: true
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Check formatting
on:
merge_group:
push:
branches:
- 'main'
- 'stable-*'
pull_request:

jobs:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lint-css.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: CSS Linting
on:
merge_group:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
branches:
- 'main'
- 'stable-*'
paths:
- 'package.json'
- 'yarn.lock'
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lint-haml.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Haml Linting
on:
merge_group:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
branches:
- 'main'
- 'stable-*'
paths:
- '.github/workflows/haml-lint-problem-matcher.json'
- '.github/workflows/lint-haml.yml'
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: JavaScript Linting
on:
merge_group:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
branches:
- 'main'
- 'stable-*'
paths:
- 'package.json'
- 'yarn.lock'
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lint-ruby.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Ruby Linting
on:
merge_group:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
branches:
- 'main'
- 'stable-*'
paths:
- 'Gemfile*'
- '.rubocop*.yml'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rebase-needed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:
jobs:
label-rebase-needed:
runs-on: ubuntu-latest
if: github.repository == 'glitch-soc/mastodon'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test-js.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: JavaScript Testing
on:
merge_group:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
branches:
- 'main'
- 'stable-*'
paths:
- 'package.json'
- 'yarn.lock'
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/test-migrations.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Historical data migration test

on:
merge_group:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
branches:
- 'main'
- 'stable-*'
paths:
- 'Gemfile*'
- '.ruby-version'
- '**/*.rb'
- '.github/workflows/test-migrations.yml'
- 'lib/tasks/tests.rake'

pull_request:
paths:
- 'Gemfile*'
- '.ruby-version'
- '**/*.rb'
- '.github/workflows/test-migrations.yml'
- 'lib/tasks/tests.rake'

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.yml", "lib/tasks/tests.rake"]'

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

strategy:
fail-fast: false
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Ruby Testing

on:
merge_group:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
branches:
- 'main'
- 'stable-*'
pull_request:

env:
Expand Down Expand Up @@ -41,11 +42,24 @@ jobs:
with:
onlyProduction: 'true'

- name: Cache assets from compilation
uses: actions/cache@v4
with:
path: |
public/assets
public/packs
public/packs-test
tmp/cache/webpacker
key: ${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
restore-keys: |
${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}
${{ matrix.mode }}-assets-main
${{ matrix.mode }}-assets
- name: Precompile assets
# Previously had set this, but it's not supported
# export NODE_OPTIONS=--openssl-legacy-provider
run: |-
./bin/rails assets:precompile
bin/rails assets:precompile
- name: Archive asset artifacts
run: |
Expand Down Expand Up @@ -223,7 +237,7 @@ jobs:
- name: Load database schema
run: './bin/rails db:create db:schema:load db:seed'

- run: bin/rspec --tag paperclip_processing
- run: bin/rspec --tag attachment_processing

- name: Upload coverage reports to Codecov
if: matrix.ruby-version == '.ruby-version'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15
20.17
Loading

0 comments on commit 96d9f4a

Please sign in to comment.