-
Notifications
You must be signed in to change notification settings - Fork 18
78 lines (65 loc) · 1.79 KB
/
Copy pathci.yml
File metadata and controls
78 lines (65 loc) · 1.79 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
name: CI
on: [push]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
container:
image: perl:5.40
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
steps:
- name: checkout
uses: actions/checkout@v3
- name: install psql
run: apt-get update && apt-get install -y --no-install-recommends postgresql-client
- name: create db
env:
PGPASSWORD: postgres
run: psql -h postgres -U postgres -c 'create database cs_test;'
- name: install dependencies
run: cpanm -n --installdeps .
- name: perl version
run: perl -v
- name: postgresq version
env:
PGPASSWORD: postgres
run: psql -h postgres -U postgres -c 'select version();'
- name: run tests
env:
POSTGRES_URI: postgresql://postgres:postgres@postgres:5432/cs_test
run: prove -lv t
build_and_push:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout
uses: actions/checkout@v3
- name: login to registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: root
password: ${{ secrets.GITHUB_TOKEN }}
- name: extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: build and push image to registry
uses: docker/build-push-action@v3
with:
file: docker/Dockerfile
context: .
cache-from: type=gha
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}