Skip to content

Instantly share code, notes, and snippets.

@theguuholi
Created April 1, 2021 14:44
Show Gist options
  • Save theguuholi/91a0848025eef96a158001846e9ca2a4 to your computer and use it in GitHub Desktop.
Save theguuholi/91a0848025eef96a158001846e9ca2a4 to your computer and use it in GitHub Desktop.
GitHub Actions CI
name: CI
on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
otp-version: '23.0'
elixir-version: '1.10.1'
- uses: actions/cache@v2
env:
cache-name: cache-elixir-deps
with:
path: |
deps
_build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: deps
run: mix deps.get
- name: LINT CODE
run: mix credo --strict
check_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
otp-version: '23.0'
elixir-version: '1.10.1'
- uses: actions/cache@v2
env:
cache-name: cache-elixir-deps
with:
path: |
deps
_build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: deps
run: mix deps.get
- name: Format
run: mix format --check-formatted
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
otp-version: '23.0'
elixir-version: '1.10.1'
- uses: actions/cache@v2
env:
cache-name: cache-elixir-deps
with:
path: |
deps
_build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: deps
run: mix deps.get
- name: Format
run: mix sobelow --config
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
otp-version: '23.0'
elixir-version: '1.10.1'
- uses: actions/cache@v2
env:
cache-name: cache-elixir-deps
with:
path: |
deps
_build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}-test
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: ==> 🔎 Integrating test
run: mix coveralls.json
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
services:
pg:
image: postgres:12
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment