Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .credo.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
%{
configs: [
%{
name: "default",
files: %{
included: ["lib/", "src/", "web/", "apps/"],
excluded: []
},
plugins: [],
requires: [],
strict: false,
parse_timeout: 5000,
color: true,
checks: %{
disabled: [
{Credo.Check.Design.TagTODO, []},
{Credo.Check.Consistency.ExceptionNames, []},
{Credo.Check.Refactor.Nesting, []},
{Credo.Check.Refactor.CyclomaticComplexity, []},
{Credo.Check.Readability.WithSingleClause, []},
{Credo.Check.Readability.AliasOrder, []},
{Credo.Check.Readability.StringSigils, []},
{Credo.Check.Refactor.Apply, []}
]
}
}
]
}
7 changes: 5 additions & 2 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[
import_deps: [:phoenix],
inputs: ["*.{ex,exs}", "{config,lib,test}/**/*.{ex,exs}"]
import_deps: [:ecto, :ecto_sql, :phoenix, :open_api_spex],
subdirectories: ["priv/*/migrations"],
plugins: [Phoenix.LiveView.HTMLFormatter],
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/*seeds*.exs"],
line_length: 120
]
6 changes: 3 additions & 3 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- uses: akhilerm/tag-push-action@v2.1.0
with:
src: docker.io/supabase/realtime:${{ inputs.version }}
src: docker.io/tealbase/realtime:${{ inputs.version }}
dst: |
public.ecr.aws/supabase/realtime:${{ inputs.version }}
ghcr.io/supabase/realtime:${{ inputs.version }}
public.ecr.aws/tealbase/realtime:${{ inputs.version }}
ghcr.io/tealbase/realtime:${{ inputs.version }}
18 changes: 0 additions & 18 deletions .github/workflows/prod.yml

This file was deleted.

45 changes: 32 additions & 13 deletions .github/workflows/prod_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ name: Build Production
on:
push:
branches:
- 'main'
- "main"
paths:
- "lib/**"
- "config/**"
- "priv/**"
- "assets/**"
- "rel/**"
- "mix.exs"
- "Dockerfile"
- "run.sh"

jobs:
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
published: ${{ steps.semantic.outputs.new_release_published }}
version: ${{ steps.semantic.outputs.new_release_version }}
Expand All @@ -20,7 +30,7 @@ jobs:

docker_x86_release:
needs: release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: needs.release.outputs.published == 'true'
timeout-minutes: 120
env:
Expand All @@ -32,9 +42,10 @@ jobs:
uses: docker/metadata-action@v4
with:
images: |
supabase/realtime
tealbase/realtime
tags: |
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }}
type=raw,value=latest_${{ env.arch }}

- uses: docker/setup-buildx-action@v2

Expand Down Expand Up @@ -68,9 +79,10 @@ jobs:
uses: docker/metadata-action@v4
with:
images: |
supabase/realtime
tealbase/realtime
tags: |
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }}
type=raw,value=latest_${{ env.arch }}

- uses: docker/login-action@v2
with:
Expand Down Expand Up @@ -108,11 +120,17 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Merge multi-arch manifests
- name: Merge multi-arch manifests for versioned output
run: |
docker buildx imagetools create -t supabase/realtime:v${{ needs.release.outputs.version }} \
supabase/realtime@${{ needs.docker_x86_release.outputs.image_digest }} \
supabase/realtime@${{ needs.docker_arm_release.outputs.image_digest }}
docker buildx imagetools create -t tealbase/realtime:v${{ needs.release.outputs.version }} \
tealbase/realtime@${{ needs.docker_x86_release.outputs.image_digest }} \
tealbase/realtime@${{ needs.docker_arm_release.outputs.image_digest }}

- name: Merge multi-arch manifests for latest output
run: |
docker buildx imagetools create -t tealbase/realtime:latest \
tealbase/realtime@${{ needs.docker_x86_release.outputs.image_digest }} \
tealbase/realtime@${{ needs.docker_arm_release.outputs.image_digest }}

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -135,10 +153,10 @@ jobs:
- name: Mirror to ECR
uses: akhilerm/tag-push-action@v2.0.0
with:
src: docker.io/supabase/realtime:v${{ needs.release.outputs.version }}
src: docker.io/tealbase/realtime:v${{ needs.release.outputs.version }}
dst: |
public.ecr.aws/supabase/realtime:v${{ needs.release.outputs.version }}
ghcr.io/supabase/realtime:v${{ needs.release.outputs.version }}
public.ecr.aws/tealbase/realtime:v${{ needs.release.outputs.version }}
ghcr.io/tealbase/realtime:v${{ needs.release.outputs.version }}

update-branch-name:
needs: [release, docker_x86_release, docker_arm_release, merge_manifest]
Expand All @@ -148,7 +166,8 @@ jobs:
uses: actions/checkout@v2
with:
ref: refs/heads/main

- name: Update branch name
run: |
git branch -m main releases/v${{ needs.release.outputs.version }}
git push origin HEAD:releases/v${{ needs.release.outputs.version }}
git push origin HEAD:releases/v${{ needs.release.outputs.version }}
11 changes: 6 additions & 5 deletions .github/workflows/prod_linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- release

jobs:
format:
name: Formatting Checks
Expand All @@ -14,10 +15,10 @@ jobs:
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: 25.x # Define the OTP version [required]
elixir-version: 1.14.x # Define the elixir version [required]
otp-version: 26.x # Define the OTP version [required]
elixir-version: 1.16.x # Define the elixir version [required]
- name: Cache Mix
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
Expand All @@ -27,15 +28,15 @@ jobs:
- name: Install dependencies
run: mix deps.get
- name: Set up Postgres
run: docker-compose -f docker-compose.dbs.yml up -d
run: docker compose -f docker-compose.dbs.yml up -d
- name: Run database migrations
run: mix ecto.migrate
- name: Run format check
run: mix format --check-formatted
- name: Credo checks
run: mix credo --strict --mute-exit-status
- name: Retrieve PLT Cache
uses: actions/cache@v1
uses: actions/cache@v4
id: plt-cache
with:
path: priv/plts
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/staging.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/staging_tealbench.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
name: Staging Formatting Checks
name: Tests
on:
pull_request:
branches:
- main
paths:
- "lib/**"
- "test/**"
- "config/**"
- "priv/**"
- "assets/**"
- "rel/**"
- "mix.exs"
- "Dockerfile"
- "run.sh"

push:
branches:
- main

jobs:
format:
name: Formatting Checks
tests:
name: Tests
runs-on: ubuntu-latest

steps:
Expand All @@ -14,10 +29,10 @@ jobs:
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: 25.x # Define the OTP version [required]
elixir-version: 1.14.x # Define the elixir version [required]
otp-version: 27.x # Define the OTP version [required]
elixir-version: 1.17.x # Define the elixir version [required]
- name: Cache Mix
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
Expand All @@ -27,17 +42,23 @@ jobs:
- name: Install dependencies
run: mix deps.get
- name: Set up Postgres
run: docker-compose -f docker-compose.dbs.yml up -d
run: docker compose -f docker-compose.dbs.yml up -d
- name: Run main database migrations
run: mix ecto.migrate --log-migrator-sql
- name: Run database tenant migrations
run: mix ecto.migrate --migrations-path lib/extensions/postgres_cdc_rls/repo/migrations
run: mix ecto.migrate --migrations-path lib/realtime/tenants/repo/migrations
- name: Run format check
run: mix format --check-formatted
- name: Credo checks
run: mix credo --strict --mute-exit-status
run: mix credo
- name: Run hex audit
run: mix hex.audit
- name: Run mix_audit
run: mix deps.audit --ignore-advisory-ids GHSA-vq52-99r9-h5pw,GHSA-9fm9-hp7p-53mf
- name: Run sobelow
run: mix sobelow --config .sobelow-conf
- name: Retrieve PLT Cache
uses: actions/cache@v1
uses: actions/cache@v4
id: plt-cache
with:
path: priv/plts
Expand All @@ -49,5 +70,11 @@ jobs:
mix dialyzer.build
- name: Run dialyzer
run: mix dialyzer
- name: Run dev seeds
run: DB_ENC_KEY="1234567890123456" mix ecto.setup
- name: Start epmd
run: epmd -daemon
- name: Run tests
run: mix test
run: MIX_ENV=test MAX_CASES=1 mix coveralls.github --trace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 18 additions & 7 deletions .github/workflows/version_updated.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- 'main'
- "main"
paths:
- "lib/**"
- "config/**"
- "priv/**"
- "assets/**"
- "rel/**"
- "mix.exs"
- "Dockerfile"
- "run.sh"

permissions:
contents: read

name: Default Checks

jobs:
versions_updated:
name: Versions Updated
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Verify Versions Updated
uses: tj-actions/changed-files@v35
uses: step-security/changed-files@v45
id: verify_changed_files
with:
files: |
mix.exs
mix.exs

- name: Fail Unless Versions Updated
id: fail_unless_changed
if: steps.verify_changed_files.outputs.any_changed == 'false'
run: |
echo "::error ::Please update the mix.exs version"
exit 1
echo "::error ::Please update the mix.exs version"
exit 1
Loading
Loading