Skip to content

[JET-2033] action 执行的接口 #25

[JET-2033] action 执行的接口

[JET-2033] action 执行的接口 #25

Workflow file for this run

name: Elixir CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- "epic/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
mix:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: byzanteam/jet-actions/setup-elixir@main
with:
version-file: .tool-versions
- name: Install Dependencies
run: mix do deps.get, deps.unlock --check-unused, deps.clean --unused
build:
runs-on: ubuntu-latest
needs: mix
steps:
- name: Setup
uses: byzanteam/jet-actions/setup-elixir@main
with:
version-file: .tool-versions
- name: Check formatting
run: mix format --check-formatted
- name: Check warnings
run: mix compile --warnings-as-errors
test:
runs-on: ubuntu-latest
needs: mix
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: resource_kit_test
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Setup
uses: byzanteam/jet-actions/setup-elixir@main
with:
version-file: .tool-versions
- name: Test
run: mix test
credo:
runs-on: ubuntu-latest
needs: mix
steps:
- name: Setup
uses: byzanteam/jet-actions/setup-elixir@main
with:
version-file: .tool-versions
- name: Credo
run: mix credo --strict
dialyzer:
runs-on: ubuntu-latest
needs: mix
steps:
- name: Setup
uses: byzanteam/jet-actions/setup-elixir@main
with:
version-file: .tool-versions
- uses: actions/cache@v4
with:
path: priv/plts
key: ${{ runner.os }}-plt-${{ hashFiles('.tool-versions') }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-plt-${{ hashFiles('.tool-versions') }}-
- name: Dialyzer
run: mix dialyzer --format github