Skip to content

Commit 2d58115

Browse files
feat: add phoenix to bugsbyte (#78)
1 parent 0ae9c77 commit 2d58115

File tree

213 files changed

+6015
-4649
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+6015
-4649
lines changed

.env.sample

Lines changed: 0 additions & 11 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 24 deletions
This file was deleted.

.formatter.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
import_deps: [:ecto, :ecto_sql, :phoenix],
3+
subdirectories: ["priv/*/migrations"],
4+
plugins: [Phoenix.LiveView.HTMLFormatter],
5+
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
6+
]

.github/actions/action.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Setup Elixir Project
2+
description: Checks out the code, configures Elixir, fetches dependencies, and manages build caching.
3+
inputs:
4+
otp-version:
5+
required: true
6+
type: string
7+
description: OTP version to set up
8+
elixir-version:
9+
required: true
10+
type: string
11+
description: Elixir version to set up
12+
build-deps:
13+
required: false
14+
type: boolean
15+
default: true
16+
description: True if we should compile dependencies
17+
build-app:
18+
required: false
19+
type: boolean
20+
default: true
21+
description: True if we should compile the application itself
22+
build-flags:
23+
required: false
24+
type: string
25+
default: '--all-warnings'
26+
description: Flags to pass to mix compile
27+
install-rebar:
28+
required: false
29+
type: boolean
30+
default: true
31+
description: By default, we will install Rebar (mix local.rebar --force).
32+
install-hex:
33+
required: false
34+
type: boolean
35+
default: true
36+
description: By default, we will install Hex (mix local.hex --force).
37+
cache-key:
38+
required: false
39+
type: string
40+
default: 'v1'
41+
description: If you need to reset the cache for some reason, you can change this key.
42+
runs:
43+
using: "composite"
44+
steps:
45+
- name: Setup Elixir
46+
uses: erlef/setup-beam@v1
47+
with:
48+
otp-version: ${{ inputs.otp-version }}
49+
elixir-version: ${{ inputs.elixir-version }}
50+
51+
- name: Get deps cache
52+
uses: actions/cache@v3
53+
id: deps-cache
54+
with:
55+
path: deps/
56+
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '**/mix.lock')) }}
57+
restore-keys: |
58+
${{ runner.os }}-mix-
59+
60+
- name: Get build cache
61+
uses: actions/cache@v3
62+
id: build-cache
63+
with:
64+
path: _build/${{env.MIX_ENV}}/
65+
key: build-${{ inputs.cache-key }}-${{ runner.os }}-${{ inputs.otp-version }}-${{ inputs.elixir-version }}-${{ env.MIX_ENV }}-${{ hashFiles('**/mix.lock') }}
66+
restore-keys: |
67+
build-${{ inputs.cache-key }}-${{ runner.os }}-${{ inputs.otp-version }}-${{ inputs.elixir-version }}-${{ env.MIX_ENV }}-
68+
69+
- name: Clean to rule out incremental build as a source of flakiness
70+
if: github.run_attempt != '1'
71+
run: |
72+
mix deps.clean --all
73+
mix clean
74+
shell: sh
75+
76+
- name: Install Rebar
77+
run: mix local.rebar --force
78+
shell: sh
79+
if: inputs.install-rebar == 'true'
80+
81+
- name: Install Hex
82+
run: mix local.hex --force
83+
shell: sh
84+
if: inputs.install-hex == 'true'
85+
86+
- name: Install Dependencies
87+
run: mix deps.get
88+
shell: sh
89+
90+
- name: Compile Dependencies
91+
run: mix deps.compile
92+
shell: sh
93+
if: inputs.build-deps == 'true'
94+
95+
- name: Compile Application
96+
run: mix compile ${{ inputs.build-flags }}
97+
shell: sh
98+
if: inputs.build-app == 'true'
-80.9 KB
Binary file not shown.

.github/workflows/style.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
name: CI Style
1+
name: Code Quality
22

33
on:
44
pull_request:
55
branches: [main]
66
types: [opened, synchronize]
7+
paths:
8+
- "**/*.ex"
9+
- "**/*.exs"
10+
- "**/*.html.heex"
711

812
jobs:
9-
build:
13+
style:
1014
runs-on: ubuntu-latest
15+
name: Code Quality
1116

1217
strategy:
1318
matrix:
14-
node-version: [20.x]
19+
otp: [27.x]
20+
elixir: [1.15.x]
1521

1622
steps:
17-
- uses: actions/checkout@v3
23+
- name: ☁️ Checkout repository
24+
uses: actions/checkout@v3
1825

19-
- name: Setup node
20-
uses: actions/setup-node@v3
26+
- name: 💧 Setup Elixir ${{ matrix.elixir }} (OTP ${{matrix.otp}})
27+
uses: ./.github/actions
2128
with:
22-
node-version: ${{ matrix.node }}
29+
otp-version: ${{ matrix.otp }}
30+
elixir-version: ${{ matrix.elixir }}
31+
build-flags: --all-warnings --warnings-as-errors
2332

24-
- uses: actions/cache@v3
25-
with:
26-
path: ~/.npm
27-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
28-
restore-keys: |
29-
${{ runner.os }}-node-
30-
31-
- name: Install dependencies
32-
run: npm install
33-
34-
- name: Check code formatting
35-
run: npm run format
33+
- name: 🎨 Check code formating
34+
run: mix format --check-formatted
3635

37-
- name: Lint the code
38-
run: npm run lint
36+
- name: 🔍 Lint the code
37+
run: mix credo --all --strict

.github/workflows/test.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "**/*.ex"
8+
- "**/*.exs"
9+
- "**/*.html.heex"
10+
pull_request:
11+
branches: [main]
12+
types: [opened, synchronize]
13+
paths:
14+
- "**/*.ex"
15+
- "**/*.exs"
16+
- "**/*.html.heex"
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
22+
env:
23+
MIX_ENV: test
24+
25+
strategy:
26+
matrix:
27+
otp: [27.x]
28+
elixir: [1.15.x]
29+
30+
services:
31+
db:
32+
image: postgres:14.1
33+
ports:
34+
- 5432:5432
35+
env:
36+
POSTGRES_USERNAME: postgres
37+
POSTGRES_PASSWORD: postgres
38+
POSTGRES_HOSTNAME: 0.0.0.0
39+
40+
steps:
41+
- name: ☁️ Checkout repository
42+
uses: actions/checkout@v3
43+
44+
- name: 💧 Setup Elixir ${{ matrix.elixir }} (OTP ${{matrix.otp}})
45+
uses: ./.github/actions
46+
with:
47+
otp-version: ${{ matrix.otp }}
48+
elixir-version: ${{ matrix.elixir }}
49+
build-flags: --all-warnings --warnings-as-errors
50+
51+
- name: 🔬 Run the tests
52+
run: mix test --warnings-as-errors

.gitignore

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
1-
node_modules/
2-
dist/
3-
*.tsbuildinfo
4-
.DS_Store
5-
.vercel
6-
.netlify
7-
_site/
8-
scripts/smoke/*-main/
9-
scripts/memory/project/src/pages/
10-
benchmark/projects/
11-
benchmark/results/
12-
*.log
13-
package-lock.json
14-
.turbo/
15-
.eslintcache
16-
.pnpm-store
17-
.astro
18-
.next/
19-
callous-corot/
20-
21-
# ignore top-level vscode settings
22-
/.vscode/settings.json
23-
24-
# do not commit .env files or any files that end with `.env`
25-
*.env
26-
27-
packages/astro/src/**/*.prebuilt.ts
28-
!packages/astro/vendor/vite/dist
29-
packages/integrations/**/.netlify/
30-
31-
# exclude IntelliJ/WebStorm stuff
32-
.idea
33-
34-
# ignore content collection generated files
35-
packages/**/test/**/fixtures/**/.astro/
36-
packages/**/test/**/fixtures/**/env.d.ts
37-
packages/**/e2e/**/fixtures/**/.astro/
38-
packages/**/e2e/**/fixtures/**/env.d.ts
39-
examples/**/.astro/
40-
examples/**/env.d.ts
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Temporary files, for example, from tests.
23+
/tmp/
24+
25+
# Ignore package tarball (built via "mix hex.build").
26+
bugsbyte-*.tar
27+
28+
# Ignore assets that are produced by build tools.
29+
/priv/static/assets/
30+
31+
# Ignore digested assets cache.
32+
/priv/static/cache_manifest.json
33+
34+
# In case you use Node.js/npm, you want to ignore these.
35+
npm-debug.log
36+
/assets/node_modules/
37+

.prettierrc.mjs

Lines changed: 0 additions & 12 deletions
This file was deleted.

.tool-versions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
nodejs 20.8.0
1+
erlang 26.2.1
2+
elixir 1.15.7

0 commit comments

Comments
 (0)