-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (94 loc) · 2.57 KB
/
coverage.yaml
File metadata and controls
114 lines (94 loc) · 2.57 KB
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
107
108
109
110
111
112
113
114
name: Elixir CI
on:
workflow_call:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build and test
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
services:
postgres:
image: postgres:13-alpine
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1920x1080x24 > /dev/null 2>&1 &
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "28.0.2"
elixir-version: "1.19.0-otp-28"
- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Compilation
run: mix compile --warnings-as-errors
- name: Check formatting
run: mix format --check-formatted
- name: Assets
run: mix assets.build
- name: Credo
run: mix credo
- name: Run tests
run: mix coveralls.json
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: kainlite/tr
docker:
name: Build and push Docker image
runs-on: ubuntu-24.04-arm
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64
push: true
tags: |
ghcr.io/kainlite/tr:latest
ghcr.io/kainlite/tr:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max