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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .env.sample

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc.cjs

This file was deleted.

6 changes: 6 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
import_deps: [:ecto, :ecto_sql, :phoenix],
subdirectories: ["priv/*/migrations"],
plugins: [Phoenix.LiveView.HTMLFormatter],
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
]
98 changes: 98 additions & 0 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Setup Elixir Project
description: Checks out the code, configures Elixir, fetches dependencies, and manages build caching.
inputs:
otp-version:
required: true
type: string
description: OTP version to set up
elixir-version:
required: true
type: string
description: Elixir version to set up
build-deps:
required: false
type: boolean
default: true
description: True if we should compile dependencies
build-app:
required: false
type: boolean
default: true
description: True if we should compile the application itself
build-flags:
required: false
type: string
default: '--all-warnings'
description: Flags to pass to mix compile
install-rebar:
required: false
type: boolean
default: true
description: By default, we will install Rebar (mix local.rebar --force).
install-hex:
required: false
type: boolean
default: true
description: By default, we will install Hex (mix local.hex --force).
cache-key:
required: false
type: string
default: 'v1'
description: If you need to reset the cache for some reason, you can change this key.
runs:
using: "composite"
steps:
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ inputs.otp-version }}
elixir-version: ${{ inputs.elixir-version }}

- name: Get deps cache
uses: actions/cache@v3
id: deps-cache
with:
path: deps/
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '**/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-

- name: Get build cache
uses: actions/cache@v3
id: build-cache
with:
path: _build/${{env.MIX_ENV}}/
key: build-${{ inputs.cache-key }}-${{ runner.os }}-${{ inputs.otp-version }}-${{ inputs.elixir-version }}-${{ env.MIX_ENV }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
build-${{ inputs.cache-key }}-${{ runner.os }}-${{ inputs.otp-version }}-${{ inputs.elixir-version }}-${{ env.MIX_ENV }}-

- name: Clean to rule out incremental build as a source of flakiness
if: github.run_attempt != '1'
run: |
mix deps.clean --all
mix clean
shell: sh

- name: Install Rebar
run: mix local.rebar --force
shell: sh
if: inputs.install-rebar == 'true'

- name: Install Hex
run: mix local.hex --force
shell: sh
if: inputs.install-hex == 'true'

- name: Install Dependencies
run: mix deps.get
shell: sh

- name: Compile Dependencies
run: mix deps.compile
shell: sh
if: inputs.build-deps == 'true'

- name: Compile Application
run: mix compile ${{ inputs.build-flags }}
shell: sh
if: inputs.build-app == 'true'
Binary file removed .github/brand/bugsbyte-banner24.png
Binary file not shown.
41 changes: 20 additions & 21 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
name: CI Style
name: Code Quality

on:
pull_request:
branches: [main]
types: [opened, synchronize]
paths:
- "**/*.ex"
- "**/*.exs"
- "**/*.html.heex"

jobs:
build:
style:
runs-on: ubuntu-latest
name: Code Quality

strategy:
matrix:
node-version: [20.x]
otp: [27.x]
elixir: [1.15.x]

steps:
- uses: actions/checkout@v3
- name: ☁️ Checkout repository
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
- name: 💧 Setup Elixir ${{ matrix.elixir }} (OTP ${{matrix.otp}})
uses: ./.github/actions
with:
node-version: ${{ matrix.node }}
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
build-flags: --all-warnings --warnings-as-errors

- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm install

- name: Check code formatting
run: npm run format
- name: 🎨 Check code formating
run: mix format --check-formatted

- name: Lint the code
run: npm run lint
- name: 🔍 Lint the code
run: mix credo --all --strict
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Test

on:
push:
branches: [main]
paths:
- "**/*.ex"
- "**/*.exs"
- "**/*.html.heex"
pull_request:
branches: [main]
types: [opened, synchronize]
paths:
- "**/*.ex"
- "**/*.exs"
- "**/*.html.heex"

jobs:
build:
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
env:
MIX_ENV: test

strategy:
matrix:
otp: [27.x]
elixir: [1.15.x]

services:
db:
image: postgres:14.1
ports:
- 5432:5432
env:
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOSTNAME: 0.0.0.0

steps:
- name: ☁️ Checkout repository
uses: actions/checkout@v3

- name: 💧 Setup Elixir ${{ matrix.elixir }} (OTP ${{matrix.otp}})
uses: ./.github/actions
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
build-flags: --all-warnings --warnings-as-errors

- name: 🔬 Run the tests
run: mix test --warnings-as-errors
77 changes: 37 additions & 40 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
node_modules/
dist/
*.tsbuildinfo
.DS_Store
.vercel
.netlify
_site/
scripts/smoke/*-main/
scripts/memory/project/src/pages/
benchmark/projects/
benchmark/results/
*.log
package-lock.json
.turbo/
.eslintcache
.pnpm-store
.astro
.next/
callous-corot/

# ignore top-level vscode settings
/.vscode/settings.json

# do not commit .env files or any files that end with `.env`
*.env

packages/astro/src/**/*.prebuilt.ts
!packages/astro/vendor/vite/dist
packages/integrations/**/.netlify/

# exclude IntelliJ/WebStorm stuff
.idea

# ignore content collection generated files
packages/**/test/**/fixtures/**/.astro/
packages/**/test/**/fixtures/**/env.d.ts
packages/**/e2e/**/fixtures/**/.astro/
packages/**/e2e/**/fixtures/**/env.d.ts
examples/**/.astro/
examples/**/env.d.ts
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Temporary files, for example, from tests.
/tmp/

# Ignore package tarball (built via "mix hex.build").
bugsbyte-*.tar

# Ignore assets that are produced by build tools.
/priv/static/assets/

# Ignore digested assets cache.
/priv/static/cache_manifest.json

# In case you use Node.js/npm, you want to ignore these.
npm-debug.log
/assets/node_modules/

12 changes: 0 additions & 12 deletions .prettierrc.mjs

This file was deleted.

3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nodejs 20.8.0
erlang 26.2.1
elixir 1.15.7
Loading