Skip to content

Commit

Permalink
chore(ci): dont run ci on push to main (#13)
Browse files Browse the repository at this point in the history
* dont run ci on push to main

* rm cache doctests

* use seetup_all instead

* more setup_all for cache

* kill ets after test

* add back cache test, fck dialyzer

* rm test again
  • Loading branch information
cschmatzler authored Aug 24, 2023
1 parent 068f2a1 commit bfd88c7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 33 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: CI
on:
push:
branches:
- main
pull_request:

jobs:
test:
name: Test
Expand Down
6 changes: 0 additions & 6 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ARG --global --required BASE
ci:
BUILD +test
BUILD +lint
BUILD +typespecs

setup-base:
FROM hexpm/elixir:$BASE
Expand Down Expand Up @@ -40,8 +39,3 @@ lint:
COPY .credo.exs .formatter.exs .
RUN mix format --check-formatted
RUN mix credo

typespecs:
FROM +build

RUN mix dialyzer
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ defmodule Idiom.MixProject do
{:uniq, "~> 0.6"},
{:credo, "~> 1.7", only: [:dev, :test]},
{:ex_doc, "~> 0.30", only: :dev},
{:dialyxir, "~> 1.3", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.17", only: :test}
]
end
Expand Down
2 changes: 1 addition & 1 deletion test/idiom/cache/get_translation_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Idiom.Cache.GetTranslationTest do

@cache_table_name :get_translation_test

setup do
setup_all do
initial_state = File.read!("test/data.json") |> Jason.decode!()
Cache.init(initial_state, @cache_table_name)
end
Expand Down
10 changes: 9 additions & 1 deletion test/idiom/cache/init_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ defmodule Idiom.Cache.InitTest do
alias Idiom.Cache

setup do
%{default_table_name: Cache.cache_table_name()}
default_table_name = Cache.cache_table_name()

on_exit(fn ->
if :ets.info(default_table_name) != :undefined do
:ets.delete(default_table_name)
end
end)

%{default_table_name: default_table_name}
end

test "initializes a public ETS with read concurrency table", %{default_table_name: default_table_name} do
Expand Down
2 changes: 1 addition & 1 deletion test/idiom/cache/insert_keys_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Idiom.Cache.InsertKeysTest do

@cache_table_name :insert_keys_test

setup do
setup_all do
initial_state = File.read!("test/data.json") |> Jason.decode!()
Cache.init(initial_state, @cache_table_name)
end
Expand Down
18 changes: 0 additions & 18 deletions test/idiom/cache_test.exs

This file was deleted.

2 changes: 1 addition & 1 deletion test/idiom/idiom/t_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Idiom.Idiom.TTest do
use ExUnit.Case, async: true
alias Idiom.Cache

setup do
setup_all do
File.read!("test/data.json")
|> Jason.decode!()
|> Cache.init(:t_test)
Expand Down
2 changes: 1 addition & 1 deletion test/idiom/idiom_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Idiom.IdiomTest do
use ExUnit.Case, async: true
alias Idiom.Cache

setup do
setup_all do
File.read!("test/data.json")
|> Jason.decode!()
|> Cache.init()
Expand Down

0 comments on commit bfd88c7

Please sign in to comment.