Skip to content

Commit

Permalink
Set mix env when running opsmo embed
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Jan 29, 2025
1 parent 72ef09b commit a66ba7a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ jobs:
container:
image: alpine:3.20

services:
postgres:
image: postgres:15.4
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand All @@ -39,7 +51,7 @@ jobs:
deps
_build
priv/plts
key: ${{ runner.os }}-uplink-${{ hashFiles('mix.lock') }}-v3
key: ${{ runner.os }}-uplink-${{ hashFiles('mix.lock') }}-v4

- name: Install Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
Expand All @@ -50,8 +62,15 @@ jobs:
mix deps.get
mix deps.compile
MIX_ENV=test mix deps.compile
MIX_ENV=test mix opsmo.embed
mix dialyzer --plt
env:
POSTGRES_HOST: postgres
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}

static_code_analysis:
name: Static Code Analysis
needs: deps
Expand Down Expand Up @@ -85,7 +104,7 @@ jobs:
deps
_build
priv/plts
key: ${{ runner.os }}-uplink-${{ hashFiles('mix.lock') }}-v3
key: ${{ runner.os }}-uplink-${{ hashFiles('mix.lock') }}-v4

- name: Check Code Format
run: mix format --check-formatted
Expand Down Expand Up @@ -138,11 +157,10 @@ jobs:
deps
_build
priv/plts
key: ${{ runner.os }}-uplink-${{ hashFiles('mix.lock') }}-v3
key: ${{ runner.os }}-uplink-${{ hashFiles('mix.lock') }}-v4

- name: Run Tests
run: |
mix opsmo.embed
mix test --trace --slowest 10
env:
Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ config :uplink, :drivers, aws_s3: Uplink.Drivers.Bucket.AwsMock
# config :plug, :validate_header_keys_during_test, false
# Print only warnings and errors during test
# Disable logging in tests
config :logger, level: :warn
config :logger, level: :warning

0 comments on commit a66ba7a

Please sign in to comment.