Skip to content

Merge pull request #1 from daniboybye/dependabot/hex/phoenix-c1a7f0bdbf #17

Merge pull request #1 from daniboybye/dependabot/hex/phoenix-c1a7f0bdbf

Merge pull request #1 from daniboybye/dependabot/hex/phoenix-c1a7f0bdbf #17

name: Build WebUI, Test and Analyze
# Runs on every PR and every push to main. Kept intentionally on the cheapest
# GitHub-hosted image (ubuntu-24.04, 1x billing) — no macOS/Windows packaging
# happens here. Platform artifacts are produced by .github/workflows/release.yml.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Quality and tests
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
MIX_ENV: dev
steps:
- name: Check out WebUI
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Scan WebUI dependencies and secrets
uses: aquasecurity/trivy-action@master # intentionally tracks latest action code
with:
scan-type: fs
scan-ref: .
trivy-config: .trivy.yaml
version: latest
- name: Install Erlang and Elixir
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1
with:
version-file: .tool-versions
version-type: strict
- name: Restore Mix cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.mix
~/.cache/rebar3
deps
_build
key: mix-${{ runner.os }}-${{ hashFiles('.tool-versions', 'mix.lock') }}
- name: Install Hex and Rebar
run: |
mix local.hex --force
mix local.rebar --force
- name: Fetch dependencies
run: mix deps.get
- name: Audit dependency metadata
run: |
mix deps.unlock --check-unused
mix hex.audit
- name: Check formatting
run: mix format --check-formatted
- name: Compile development code
run: mix compile --warnings-as-errors
- name: Compile test code
env:
MIX_ENV: test
run: mix compile --warnings-as-errors
- name: Run Credo
run: mix credo --all
- name: Run Sobelow
run: mix sobelow --skip --strict --private --exit --threshold medium
- name: Run Dialyzer
run: mix dialyzer
- name: Run coverage tests
env:
MIX_ENV: test
run: timeout --signal=TERM --kill-after=5s 60s mix coveralls.json --no-compile
- name: Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
disable_search: true
fail_ci_if_error: true
files: cover/excoveralls.json
use_oidc: true