mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
name: Elixir Test and report coverage
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
env:
|
|
CACHE_NAME_DEPS: cache-elixir-deps
|
|
CACHE_NAME_COMPILED_TEST: cache-compiled-test-build
|
|
ELIXIR_ASSERT_TIMEOUT: 1000
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-24.04
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
services:
|
|
db:
|
|
image: postgres:18-trixie
|
|
ports: ["5432:5432"]
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
options: >-
|
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
|
|
- name: Setup Elixir and Cache Dependencies
|
|
id: setup-elixir-and-cache-deps
|
|
uses: ./.github/actions/setup-elixir-and-cache-deps
|
|
with:
|
|
cache-name-deps: ${{ env.CACHE_NAME_DEPS }}
|
|
cache-name-compiled: ${{ env.CACHE_NAME_COMPILED_TEST }}
|
|
mix-env: test
|
|
ELIXIR_ASSERT_TIMEOUT: ${{ env.ELIXIR_ASSERT_TIMEOUT }}
|
|
|
|
- name: Compile without warnings
|
|
run: mix compile --warnings-as-errors
|
|
shell: sh
|
|
|
|
- name: Run tests
|
|
run: mix test --warnings-as-errors
|
|
|
|
- name: Check Coverage
|
|
if: github.ref == 'refs/heads/main'
|
|
run: mix coveralls.github
|
|
continue-on-error: true
|
|
env:
|
|
MIX_ENV: test
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|