diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index deaaffc..8990e5c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -22,90 +22,83 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Elixir - uses: erlef/setup-beam@v1.11 - id: setup + # - name: Elixir + # uses: erlef/setup-beam@v1.11 + # id: setup + # with: + # otp-version: ${{ env.OTP_VERSION_SPEC }} + # elixir-version: ${{ env.ELIXIR_VERSION_SPEC }} + # env: + # ImageOS: ubuntu20 + + # - name: Restore Deps Cache + # uses: actions/cache/restore@v3 + # id: deps-cache + # with: + # path: deps + # key: deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} + + # - name: Restore Build Cache + # uses: actions/cache/restore@v3 + # id: build-cache + # with: + # path: _build + # key: build-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} + + # - name: Restore PLT cache + # uses: actions/cache@v2 + # id: plt-cache + # with: + # key: plt-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }} + # path: priv/plts + + # - name: Install Mix Dependencies + # if: steps.deps-cache.outputs.cache-hit != 'true' + # run: mix deps.get + + # - name: Compile + # if: steps.build-cache.outputs.cache-hit != 'true' + # run: mix compile + + # - name: Check Formatting + # run: mix format --check-formatted + + # - name: Run Credo + # run: mix credo --strict + + # - name: Run Tests + # run: mix test --cover + + - name: Coverage Reporter + uses: peek-travel/coverage-reporter@partitioned-lcov-results + id: coverage-reporter + if: github.event_name == 'pull_request' with: - otp-version: ${{ env.OTP_VERSION_SPEC }} - elixir-version: ${{ env.ELIXIR_VERSION_SPEC }} - env: - ImageOS: ubuntu20 - - - name: Restore Deps Cache - uses: actions/cache/restore@v3 - id: deps-cache - with: - path: deps - key: deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} - - - name: Restore Build Cache - uses: actions/cache/restore@v3 - id: build-cache - with: - path: _build - key: build-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} - - - name: Restore PLT cache - uses: actions/cache@v2 - id: plt-cache - with: - key: plt-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }} - path: priv/plts - - - name: Install Mix Dependencies - if: steps.deps-cache.outputs.cache-hit != 'true' - run: mix deps.get - - - name: Compile - if: steps.build-cache.outputs.cache-hit != 'true' - run: mix compile - - - name: Check Formatting - run: mix format --check-formatted - - - name: Run Credo - run: mix credo --strict - - - name: Run Tests - run: mix test --cover --export-coverage default - - - name: Run Coverage Reporter - run: | - mix coverage_reporter \ - --github-token ${{ secrets.GITHUB_TOKEN }} \ - --pull-number ${{ github.event.number }} \ - --repository ${{ github.repository }} \ - --head-branch ${{ github.head_ref }} \ - --commit-sha ${{ github.sha }} - - - name: Create Coverage Report Artifact - uses: actions/upload-artifact@v3 - with: - name: code-coverage - path: cover/reports/coverage_report.txt - - - name: Create PLTs - if: steps.plt-cache.outputs.cache-hit != 'true' - run: MIX_ENV=dev mix dialyzer --plt - - - name: Run dialyzer - run: MIX_ENV=dev mix dialyzer --format github - - - name: Save Build Cache - uses: actions/cache/save@v3 - with: - path: _build - key: build-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} - - - name: Save Deps Cache - uses: actions/cache/save@v3 - with: - path: deps - key: deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} - - - name: Save PLT cache - id: plt-cache-save - uses: actions/cache/save@v3 - with: - path: priv/plts - key: plt-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }} + lcov_path: cover/lcov.info + coverage_threshold: 80 + + # - name: Create PLTs + # if: steps.plt-cache.outputs.cache-hit != 'true' + # run: MIX_ENV=dev mix dialyzer --plt + + # - name: Run dialyzer + # run: MIX_ENV=dev mix dialyzer --format github + + # - name: Save Build Cache + # uses: actions/cache/save@v3 + # with: + # path: _build + # key: build-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} + + # - name: Save Deps Cache + # uses: actions/cache/save@v3 + # with: + # path: deps + # key: deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} + + # - name: Save PLT cache + # id: plt-cache-save + # uses: actions/cache/save@v3 + # with: + # path: priv/plts + # key: plt-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }} diff --git a/.tool-versions b/.tool-versions index af11155..af12053 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -erlang 26.0 -elixir 1.14.5-otp-26 +elixir 1.15.7-otp-26 +erlang 26.1 diff --git a/cover/lcov.info b/cover/lcov.info new file mode 100644 index 0000000..f53ac5e --- /dev/null +++ b/cover/lcov.info @@ -0,0 +1,467 @@ +TN:Elixir.Brian +SF:lib/brian.ex +FNF:0 +FNH:0 +LF:0 +LH:0 +end_of_record +TN:Elixir.Brian.Application +SF:lib/brian/application.ex +FNDA:0,config_change/3 +FNDA:1,start/2 +FNF:2 +FNH:1 +DA:10,1 +DA:24,1 +DA:25,1 +DA:32,0 +LF:4 +LH:3 +end_of_record +TN:Elixir.Brian.Wakatime +SF:lib/brian/wakatime.ex +FNDA:1,fetch_activity/0 +FNDA:1,impl/0 +FNF:2 +FNH:2 +DA:6,1 +DA:9,1 +LF:2 +LH:2 +end_of_record +TN:Elixir.Brian.Wakatime.External +SF:lib/brian/wakatime.ex +FNDA:0,fetch_activity/0 +FNDA:0,parse_activity/1 +FNF:2 +FNH:0 +DA:14,0 +DA:16,0 +DA:17,0 +DA:18,0 +DA:19,0 +DA:32,0 +DA:34,0 +DA:35,0 +LF:8 +LH:0 +end_of_record +TN:Elixir.BrianWeb +SF:lib/brian_web.ex +FNDA:3,MACRO-__using__/2 +FNDA:0,channel/0 +FNDA:0,controller/0 +FNDA:0,html/0 +FNDA:0,html_helpers/0 +FNDA:0,live_component/0 +FNDA:0,live_view/0 +FNDA:0,router/0 +FNDA:3,static_paths/0 +FNDA:3,verified_routes/0 +FNF:10 +FNH:3 +DA:20,3 +DA:109,3 +LF:2 +LH:2 +end_of_record +TN:Elixir.BrianWeb.CodeCoverageLive +SF:lib/brian_web/live/code_coverage_live.ex +FNDA:0,__components__/0 +FNDA:0,__live__/0 +FNDA:0,__phoenix_component_verify__/1 +FNDA:0,__phoenix_verify_routes__/1 +FNDA:0,render/1 +FNF:5 +FNH:0 +DA:1,0 +DA:5,0 +DA:22,0 +DA:28,0 +DA:41,0 +DA:60,0 +DA:94,0 +DA:111,0 +LF:8 +LH:0 +end_of_record +TN:Elixir.BrianWeb.ConnCase +SF:test/support/conn_case.ex +FNDA:3,MACRO-__using__/2 +FNDA:8,__ex_unit__/2 +FNDA:5,__ex_unit_setup_0/1 +FNF:3 +FNH:3 +DA:1,5 +DA:20,3 +DA:35,5 +LF:3 +LH:3 +end_of_record +TN:Elixir.BrianWeb.CoreComponents +SF:lib/brian_web/components/core_components.ex +FNDA:0,__components__/0 +FNDA:0,__phoenix_component_verify__/1 +FNDA:0,back/1 +FNDA:0,back (overridable 1)/1 +FNDA:0,button/1 +FNDA:0,button (overridable 1)/1 +FNDA:0,error/1 +FNDA:0,error (overridable 1)/1 +FNDA:6,flash/1 +FNDA:6,flash (overridable 1)/1 +FNDA:2,flash_group/1 +FNDA:2,flash_group (overridable 1)/1 +FNDA:0,header/1 +FNDA:0,header (overridable 1)/1 +FNDA:2,hide/1 +FNDA:5,hide/2 +FNDA:1,hide_modal/1 +FNDA:1,hide_modal/2 +FNDA:7,icon/1 +FNDA:7,icon (overridable 1)/1 +FNDA:0,input/1 +FNDA:0,input (overridable 1)/1 +FNDA:0,label/1 +FNDA:0,label (overridable 1)/1 +FNDA:0,list/1 +FNDA:0,list (overridable 1)/1 +FNDA:2,makeup/1 +FNDA:2,makeup (overridable 1)/1 +FNDA:1,modal/1 +FNDA:1,modal (overridable 1)/1 +FNDA:2,show/1 +FNDA:3,show/2 +FNDA:1,show_modal/1 +FNDA:1,show_modal/2 +FNDA:0,simple_form/1 +FNDA:0,simple_form (overridable 1)/1 +FNDA:0,table/1 +FNDA:0,table (overridable 1)/1 +FNDA:0,translate_error/1 +FNDA:0,translate_errors/2 +FNF:40 +FNH:18 +DA:1,7 +DA:46,1 +DA:47,1 +DA:48,1 +DA:49,1 +DA:50,1 +DA:51,1 +DA:54,1 +DA:57,1 +DA:58,1 +DA:65,1 +DA:66,1 +DA:67,1 +DA:69,1 +DA:73,1 +DA:74,1 +DA:79,1 +DA:82,1 +DA:83,1 +DA:110,6 +DA:111,2 +DA:112,6 +DA:113,2 +DA:114,2 +DA:118,2 +DA:119,2 +DA:121,2 +DA:123,2 +DA:124,2 +DA:125,2 +DA:126,2 +DA:130,2 +DA:146,2 +DA:147,2 +DA:148,2 +DA:149,2 +DA:157,2 +DA:186,0 +DA:187,0 +DA:189,0 +DA:190,0 +DA:213,0 +DA:214,0 +DA:215,0 +DA:219,0 +DA:221,0 +DA:223,0 +DA:278,0 +DA:279,0 +DA:280,0 +DA:281,0 +DA:282,0 +DA:286,0 +DA:288,0 +DA:289,0 +DA:291,0 +DA:292,0 +DA:294,0 +DA:295,0 +DA:297,0 +DA:299,0 +DA:301,0 +DA:303,0 +DA:309,0 +DA:310,0 +DA:311,0 +DA:312,0 +DA:313,0 +DA:314,0 +DA:316,0 +DA:317,0 +DA:319,0 +DA:320,0 +DA:322,0 +DA:328,0 +DA:329,0 +DA:330,0 +DA:331,0 +DA:332,0 +DA:333,0 +DA:337,0 +DA:338,0 +DA:340,0 +DA:341,0 +DA:342,0 +DA:349,0 +DA:350,0 +DA:351,0 +DA:352,0 +DA:353,0 +DA:354,0 +DA:355,0 +DA:356,0 +DA:360,0 +DA:361,0 +DA:363,0 +DA:365,0 +DA:377,0 +DA:378,0 +DA:379,0 +DA:390,0 +DA:392,0 +DA:393,0 +DA:408,0 +DA:409,0 +DA:412,0 +DA:414,0 +DA:415,0 +DA:418,0 +DA:449,0 +DA:450,0 +DA:451,0 +DA:454,0 +DA:459,0 +DA:463,0 +DA:464,0 +DA:465,0 +DA:468,0 +DA:470,0 +DA:471,0 +DA:472,0 +DA:476,0 +DA:477,0 +DA:481,0 +DA:485,0 +DA:488,0 +DA:514,0 +DA:517,0 +DA:518,0 +DA:537,0 +DA:539,0 +DA:540,0 +DA:541,0 +DA:569,7 +DA:570,7 +DA:576,2 +DA:577,3 +DA:585,2 +DA:586,5 +DA:595,1 +DA:597,1 +DA:599,1 +DA:602,1 +DA:604,1 +DA:607,1 +DA:610,1 +DA:613,1 +DA:614,1 +DA:616,1 +DA:632,0 +DA:633,0 +DA:641,0 +DA:648,2 +DA:649,2 +LF:154 +LH:55 +end_of_record +TN:Elixir.BrianWeb.Endpoint +SF:lib/brian_web/endpoint.ex +FNDA:2,__sockets__/0 +FNDA:0,broadcast/3 +FNDA:0,broadcast!/3 +FNDA:0,broadcast_from/4 +FNDA:0,broadcast_from!/4 +FNDA:1,call/2 +FNDA:1,call (overridable 2)/2 +FNDA:1,do_socket_dispatch/2 +FNDA:1,init/1 +FNDA:1,init/2 +FNDA:0,local_broadcast/3 +FNDA:0,local_broadcast_from/4 +FNDA:1,plug_builder_call/2 +FNDA:0,pubsub_server!/0 +FNDA:1,socket_dispatch/2 +FNDA:0,subscribe/1 +FNDA:0,subscribe/2 +FNDA:0,unsubscribe/1 +FNF:18 +FNH:8 +DA:1,1 +DA:2,1 +LF:2 +LH:2 +end_of_record +TN:Elixir.BrianWeb.ErrorHTML +SF:lib/brian_web/controllers/error_html.ex +FNDA:0,__components__/0 +FNDA:0,__phoenix_verify_routes__/1 +FNDA:2,render/2 +FNF:3 +FNH:1 +DA:1,0 +DA:17,2 +LF:2 +LH:1 +end_of_record +TN:Elixir.BrianWeb.ErrorJSON +SF:lib/brian_web/controllers/error_json.ex +FNDA:2,render/2 +FNF:1 +FNH:1 +DA:13,2 +LF:1 +LH:1 +end_of_record +TN:Elixir.BrianWeb.HomeLive +SF:lib/brian_web/live/home_live.ex +FNDA:0,__components__/0 +FNDA:9,__live__/0 +FNDA:0,__phoenix_component_verify__/1 +FNDA:0,__phoenix_verify_routes__/1 +FNDA:1,color/1 +FNDA:1,handle_info/2 +FNDA:2,mount/3 +FNDA:3,render/1 +FNF:8 +FNH:5 +DA:1,9 +DA:4,2 +DA:5,2 +DA:10,3 +DA:12,2 +DA:23,3 +DA:24,1 +DA:30,1 +DA:33,1 +DA:97,1 +DA:98,1 +DA:101,0 +DA:106,0 +DA:107,0 +DA:108,0 +DA:109,0 +DA:110,0 +DA:111,0 +DA:112,0 +DA:113,0 +DA:114,0 +DA:115,0 +DA:116,1 +DA:117,0 +LF:24 +LH:12 +end_of_record +TN:Elixir.BrianWeb.Layouts +SF:lib/brian_web/components/layouts.ex +FNDA:0,__components__/0 +FNDA:0,__mix_recompile__?/0 +FNDA:0,__phoenix_component_verify__/1 +FNDA:0,__phoenix_verify_routes__/1 +FNF:4 +FNH:0 +DA:1,0 +LF:1 +LH:0 +end_of_record +TN:Elixir.BrianWeb.PageController +SF:lib/brian_web/controllers/page_controller.ex +FNDA:0,__phoenix_verify_routes__/1 +FNDA:0,action/2 +FNDA:0,action (overridable 2)/2 +FNDA:0,call/2 +FNDA:0,home/2 +FNDA:0,init/1 +FNDA:0,phoenix_controller_pipeline/2 +FNF:7 +FNH:0 +DA:1,0 +DA:2,0 +DA:7,0 +LF:3 +LH:0 +end_of_record +TN:Elixir.BrianWeb.PageHTML +SF:lib/brian_web/controllers/page_html.ex +FNDA:0,__components__/0 +FNDA:0,__mix_recompile__?/0 +FNDA:0,__phoenix_component_verify__/1 +FNDA:0,__phoenix_verify_routes__/1 +FNF:4 +FNH:0 +DA:1,0 +LF:1 +LH:0 +end_of_record +TN:Elixir.BrianWeb.Router +SF:lib/brian_web/router.ex +FNDA:0,__checks__/0 +FNDA:0,__forward__/1 +FNDA:0,__helpers__/0 +FNDA:1,__match_route__/3 +FNDA:1,__pipe_through0__/1 +FNDA:0,__routes__/0 +FNDA:1,__verify_route__/1 +FNDA:0,api/2 +FNDA:1,browser/2 +FNDA:1,prepare/1 +FNF:10 +FNH:5 +DA:1,1 +DA:4,1 +DA:13,0 +DA:20,2 +DA:21,0 +LF:5 +LH:3 +end_of_record +TN:Elixir.BrianWeb.Telemetry +SF:lib/brian_web/telemetry.ex +FNDA:1,init/1 +FNDA:0,metrics/0 +FNDA:1,periodic_measurements/0 +FNDA:1,start_link/1 +FNF:4 +FNH:3 +DA:7,1 +DA:12,1 +DA:20,1 +DA:23,0 +DA:63,1 +LF:5 +LH:4 +end_of_record diff --git a/lib/brian_web/live/home_live.ex b/lib/brian_web/live/home_live.ex index dcd4ce9..cdf3a69 100644 --- a/lib/brian_web/live/home_live.ex +++ b/lib/brian_web/live/home_live.ex @@ -81,7 +81,10 @@ defmodule BrianWeb.HomeLive do