Skip to content

ammend syntax for new rag version #54

ammend syntax for new rag version

ammend syntax for new rag version #54

Workflow file for this run

name: QA
on: push
env:
MIX_ENV: test
permissions:
contents: read
jobs:
test:
services:
db:
image: postgres:16.0
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: chatbot_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
name: Build and test
strategy:
matrix:
otp: ['27.0.1']
elixir: ['1.17.2-otp-27']
steps:
# Step: Setup Elixir + Erlang image as the base.
- name: Set up Elixir
uses: erlef/[email protected]
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
# Step: Check out the code.
- name: Checkout code
uses: actions/checkout@v3
# Step: Define how to cache deps. Restores existing cache if present.
- name: Cache deps
id: cache-deps
uses: actions/cache@v3
env:
cache-name: cache-elixir-deps
with:
path: deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
# Step: Define how to cache the `_build` directory. After the first run,
# this speeds up tests runs a lot. This includes not re-compiling our
# project's downloaded deps every run.
- name: Cache compiled build
id: cache-build
uses: actions/cache@v3
env:
cache-name: cache-compiled-build
with:
path: _build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
# Step: Download project dependencies. If unchanged, uses
# the cached version.
- name: Install dependencies
run: mix deps.get
# Step: Compile the project treating any warnings as errors.
- name: Compiles without warnings
run: mix compile --warnings-as-errors
# Step: Check that the checked in code has already been formatted.
- name: Check Formatting
run: mix format --check-formatted
# Step: Execute the tests.
- name: Run tests
run: mix test
# Cache key based on Erlang/Elixir version and the mix.lock hash
- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v3
with:
key: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
path: |
priv/plts
# Create PLTs if no cache was found
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
# By default, the GitHub Cache action will only save the cache if all steps in the job succeed,
# so we separate the cache restore and save steps in case running dialyzer fails.
- name: Save PLT cache
id: plt_cache_save
uses: actions/cache/save@v3
if: steps.plt_cache.outputs.cache-hit != 'true'
with:
key: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
path: |
priv/plts
- name: Run dialyzer
# Two formats are included for ease of debugging and it is lightly recommended to use both, see https://github.com/jeremyjh/dialyxir/issues/530 for reasoning
# --format github is helpful to print the warnings in a way that GitHub understands and can place on the /files page of a PR
# --format dialyxir allows the raw GitHub actions logs to be useful because they have the full warning printed
run: MIX_ENV=dev mix dialyzer --format github --format dialyxir
- name: Run credo
run: mix credo --strict
assets:
runs-on: ubuntu-latest
name: Assets
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 23
- run: cd assets && npm ci