Skip to content

Commit b7b6cb8

Browse files
committed
switch to github actions
1 parent 1214647 commit b7b6cb8

File tree

4 files changed

+78
-31
lines changed

4 files changed

+78
-31
lines changed

.github/workflows/main.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
MIX_ENV: test
11+
12+
jobs:
13+
test:
14+
15+
runs-on: ubuntu-latest
16+
continue-on-error: ${{ matrix.development }}
17+
strategy:
18+
matrix:
19+
elixir: ['1.10.x', '1.11.x']
20+
otp: ['21.3.x', '22.2.x', '23.0.x']
21+
development: [false]
22+
include:
23+
- elixir: 'master'
24+
otp: '21.3.x'
25+
development: true
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Setup elixir
31+
uses: actions/setup-elixir@v1
32+
with:
33+
elixir-version: ${{ matrix.elixir }} # Define the elixir version [required]
34+
otp-version: ${{ matrix.otp }} # Define the OTP version [required]
35+
36+
- name: Retrieve Mix Dependencies Cache
37+
uses: actions/cache@v1
38+
id: mix-cache #id to use in retrieve action
39+
with:
40+
path: deps
41+
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
42+
43+
- name: Install Mix Dependencies
44+
if: steps.mix-cache.outputs.cache-hit != 'true'
45+
run: |
46+
mix local.rebar --force
47+
mix local.hex --force
48+
mix deps.get
49+
- name: Check Formatting
50+
run: mix format --check-formatted
51+
if: matrix.elixir == '1.11.x'
52+
53+
- name: Check Compile Warnings
54+
run: mix compile --warnings-as-errors
55+
56+
- name: Run Tests
57+
run: mix test
58+
59+
- name: Retrieve PLT Cache
60+
uses: actions/cache@v1
61+
id: plt-cache
62+
if: matrix.elixir == '1.11.x'
63+
with:
64+
path: priv/plts
65+
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
66+
67+
- name: Create PLTs
68+
if: steps.plt-cache.outputs.cache-hit != 'true' && matrix.elixir == '1.11.x'
69+
run: |
70+
mkdir -p priv/plts
71+
mix dialyzer --plt
72+
- name: Run dialyzer
73+
run: mix dialyzer --no-check --halt-exit-status
74+
if: matrix.elixir == '1.11.x'

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

mix.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ defmodule Sentry.Mixfile do
1414
deps: deps(),
1515
dialyzer: [
1616
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
17+
plt_core_path: "priv/plts",
1718
plt_add_deps: :app_tree,
1819
plt_add_apps: [:mix, :plug, :hackney]
1920
],
@@ -41,7 +42,7 @@ defmodule Sentry.Mixfile do
4142
{:jason, "~> 1.1", optional: true},
4243
{:plug, "~> 1.6", optional: true},
4344
{:plug_cowboy, "~> 2.3", optional: true},
44-
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
45+
{:dialyxir, "~> 1.0", only: [:test, :dev], runtime: false},
4546
{:ex_doc, "~> 0.23.0", only: :dev},
4647
{:bypass, "~> 2.0", only: [:test]},
4748
{:phoenix, "~> 1.5", only: [:test]},

test/event_test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ defmodule Sentry.EventTest do
254254
:cowboy,
255255
:cowboy_telemetry,
256256
:cowlib,
257+
:dialyxir,
258+
:erlex,
257259
:hackney,
258260
:idna,
259261
:jason,

0 commit comments

Comments
 (0)