-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (93 loc) · 3.03 KB
/
elixir.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Elixir CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-20.04
env:
MIX_ENV: 'test'
NETATMO_APP_ID: ${{ secrets.NETATMO_APP_ID }}
NETATMO_CLIENT_SECRET: ${{ secrets.NETATMO_CLIENT_SECRET }}
NETATMO_USER_EMAIL: ${{ secrets.NETATMO_USER_EMAIL }}
NETATMO_USER_PASSWORD: ${{ secrets.NETATMO_USER_PASSWORD }}
ALTERVISTA_USER: ${{ secrets.ALTERVISTA_USER }}
ALTERVISTA_PASSWORD: ${{ secrets.ALTERVISTA_PASSWORD }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.12.3' # Define the elixir version [required]
otp-version: '24.1.4' # Define the OTP version [required]
- name: Restore dependencies and build cache
uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Build
run: mix compile
test:
name: Test
runs-on: ubuntu-20.04
needs: build
env:
MIX_ENV: 'test'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for coveralls
NETATMO_APP_ID: ${{ secrets.NETATMO_APP_ID }}
NETATMO_CLIENT_SECRET: ${{ secrets.NETATMO_CLIENT_SECRET }}
NETATMO_USER_EMAIL: ${{ secrets.NETATMO_USER_EMAIL }}
NETATMO_USER_PASSWORD: ${{ secrets.NETATMO_USER_PASSWORD }}
ALTERVISTA_USER: ${{ secrets.ALTERVISTA_USER }}
ALTERVISTA_PASSWORD: ${{ secrets.ALTERVISTA_PASSWORD }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.12.3' # Define the elixir version [required]
otp-version: '24.1.4' # Define the OTP version [required]
experimental-otp: true
- name: Restore dependencies and build cache
uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Start PostgreSQL
uses: harmon758/postgresql-action@v1
with:
postgresql version: '14.4'
postgresql db: "webcam_fornolo_test"
postgresql user: "user"
postgresql password: "pass"
- name: Run DB migrations
run: mix ecto.setup
- name: Run tests
run: mix coveralls.github --trace
deploy:
name: Fly Deploy
runs-on: ubuntu-20.04
needs: test
if: github.ref == 'refs/heads/master'
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy
run: flyctl deploy --remote-only