Skip to content

Commit 684d790

Browse files
authored
Merge pull request #234 from dwyl/replace-travis-with-github-acctions-issue#230
PR: Replace `Travis CI` with `GitHub Actions` issue #230
2 parents 7a9edd3 + 350d94f commit 684d790

File tree

247 files changed

+190
-6247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+190
-6247
lines changed

.github/dependabot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: mix
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
time: "17:00"
8+
timezone: Europe/London
9+
ignore:
10+
# ignore all patch updates in dev dependencies ref: github.com/dwyl/technology-stack/issues/126 [alphabetical list]
11+
- dependency-name: "credo"
12+
update-types: ["version-update:semver-patch"]
13+
- dependency-name: "dialyxir"
14+
update-types: ["version-update:semver-patch"]
15+
- dependency-name: "excoveralls"
16+
update-types: ["version-update:semver-patch"]
17+
- dependency-name: "ex_doc"
18+
update-types: ["version-update:semver-patch"]
19+
- dependency-name: "esbuild"
20+
update-types: ["version-update:semver-patch"]
21+
- dependency-name: "floki"
22+
update-types: ["version-update:semver-patch"]
23+
- dependency-name: "phoenix_live_reload"
24+
update-types: ["version-update:semver-patch"]

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Elixir CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
name: Build and test
12+
runs-on: ubuntu-latest
13+
services:
14+
postgres:
15+
image: postgres:12
16+
ports: ['5432:5432']
17+
env:
18+
POSTGRES_PASSWORD: postgres
19+
options: >-
20+
--health-cmd pg_isready
21+
--health-interval 10s
22+
--health-timeout 5s
23+
--health-retries 5
24+
steps:
25+
# https://github.com/actions/checkout
26+
- uses: actions/checkout@v6
27+
# https://github.com/erlef/setup-beam
28+
- name: Set up Elixir
29+
uses: erlef/setup-beam@v1
30+
with:
31+
elixir-version: '1.18.4' # Define the elixir version [required]
32+
otp-version: '28.0.1' # Define the OTP version [required]
33+
- name: Restore dependencies cache
34+
uses: actions/cache@v4
35+
with:
36+
path: deps
37+
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
38+
restore-keys: ${{ runner.os }}-mix-
39+
- name: Install dependencies
40+
run: mix deps.get
41+
- name: Run Tests
42+
run: mix coveralls.json
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
MIX_ENV: test
46+
- name: Upload coverage to Codecov
47+
uses: codecov/codecov-action@v6
48+
49+
# Continuous Deployment to Fly.io
50+
# https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
51+
# deploy:
52+
# name: Deploy app
53+
# runs-on: ubuntu-latest
54+
# needs: build
55+
# # https://stackoverflow.com/questions/58139406/only-run-job-on-specific-branch-with-github-actions
56+
# if: github.ref == 'refs/heads/main'
57+
# env:
58+
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
59+
# steps:
60+
# - uses: actions/checkout@v2
61+
# - uses: superfly/flyctl-actions@1.1
62+
# with:
63+
# args: "deploy"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
erl_crash.dump
55
*.ez
66
.DS_Store
7+
.elixir_ls

.travis.yml

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

codecov_example/config/config.exs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
11
# This file is responsible for configuring your application
22
# and its dependencies with the aid of the Mix.Config module.
3-
use Mix.Config
4-
5-
# This configuration is loaded before any dependency and is restricted
6-
# to this project. If another project depends on this project, this
7-
# file won't be loaded nor affect the parent project. For this reason,
8-
# if you want to provide default values for your application for
9-
# 3rd-party users, it should be done in your "mix.exs" file.
10-
11-
# You can configure your application as:
12-
#
13-
# config :codecov_example, key: :value
14-
#
15-
# and access this configuration in your application as:
16-
#
17-
# Application.get_env(:codecov_example, :key)
18-
#
19-
# You can also configure a 3rd-party app:
20-
#
21-
# config :logger, level: :info
22-
#
23-
24-
# It is also possible to import configuration files, relative to this
25-
# directory. For example, you can emulate configuration per environment
26-
# by uncommenting the line below and defining dev.exs, test.exs and such.
27-
# Configuration from the imported file will override the ones defined
28-
# here (which is why it is important to import them last).
29-
#
30-
# import_config "#{Mix.env()}.exs"
3+
import Config

codecov_example/mix.lock

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

config/config.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import Config

coveralls.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"coverage_options": {
3+
"minimum_coverage": 100
4+
},
5+
"skip_files": [
6+
"test/",
7+
"examples/control/",
8+
"examples/exceptions/",
9+
"examples/functions/",
10+
"examples/macros/",
11+
"examples/nodes/",
12+
"examples/odds/",
13+
"examples/otp-server/",
14+
"examples/spawn/",
15+
"examples/strings/",
16+
"examples/typespecs/",
17+
"examples/use/"
18+
]
19+
}

examples/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Many (_most?_) of the Examples in this `/examples` dir
44
are either derived/adapted from or directly "_borrowed_"
55
from the _fantastic_ book:
6-
Programming Elixir 1.3 by the _brilliant_ Dave Thomas! @pragdave
6+
Programming Elixir 1.3 by the _brilliant_ Dave Thomas!
7+
[@pragdave](https://github.com/pragdave)
78

89
![Programming Elixir 1.3. front cover](https://cloud.githubusercontent.com/assets/194400/22402694/d13148de-e5f8-11e6-92cb-14584a353f7e.png)
910

examples/control/fizzbuzz1.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
# We make no guarantees that this code is fit for any purpose.
77
# Visit http://www.pragmaticprogrammer.com/titles/elixir13 for more book information.
88
#---
9-
defmodule FizzBuzz do
9+
defmodule FizzBuzz1 do
1010

1111
def upto(n) when n > 0, do: _downto(n, [])
1212

1313
defp _downto(0, result), do: result
1414
defp _downto(current, result) do
15-
next_answer =
15+
next_answer =
1616
cond do
17-
rem(current, 3) == 0 and rem(current, 5) == 0 ->
17+
rem(current, 3) == 0 and rem(current, 5) == 0 ->
1818
"FizzBuzz"
1919
rem(current, 3) == 0 ->
2020
"Fizz"
21-
rem(current, 5) == 0 ->
21+
rem(current, 5) == 0 ->
2222
"Buzz"
2323
true ->
2424
current

0 commit comments

Comments
 (0)