Skip to content
This repository was archived by the owner on Oct 31, 2021. It is now read-only.

Commit 86a824f

Browse files
committed
CI stuff.
1 parent 16334a8 commit 86a824f

7 files changed

+56
-10
lines changed

.github/workflows/docker-build.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- '!main'
7+
pull_request: { }
8+
9+
jobs:
10+
docker:
11+
name: Docker
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v1
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v1
19+
- name: Build Image
20+
id: docker_build
21+
uses: docker/build-push-action@v2
22+
with:
23+
push: false
24+
tags: containers.monetr.dev/rest-api

.github/workflows/go.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ on:
88

99
jobs:
1010
build:
11+
name: Build
1112
runs-on: ubuntu-latest
12-
container: golang:1.16
13+
container: golang:1.16.3
1314
env:
1415
POSTGRES_HOST: postgres
1516
POSTGRES_PASSWORD: ""
@@ -33,7 +34,7 @@ jobs:
3334
run: make dependencies
3435
- name: Build
3536
run: make build
36-
# - name: Setup Schema
37-
# run: make apply-schema-ci
38-
# - name: Test
39-
# run: go test -race -v ./...
37+
- name: Setup Schema
38+
run: make apply-schema-ci
39+
- name: Test
40+
run: make test

Dockerfile.database

-3
This file was deleted.

Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ migrations:
8181
$(info "Cleaning up temp directories")
8282
rm -rf $(CURRENT_TMP)
8383

84-
ifdef CI
85-
include Makefile.ci
84+
ifdef GITLAB_CI
85+
include Makefile.gitlab-ci
8686
endif
8787

88+
ifdef GITHUB_ACTION
89+
include Makefile.github-actions
90+
endif
91+
92+
include Makefile.tinker
93+

Makefile.github-actions

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
default:
3+
$(info "This makefile is meant to be used in CI.")
4+
5+
apply-schema-ci:
6+
ifndef GITHUB_WORKSPACE
7+
$(warning "GITHUB_WORKSPACE is not defined, are you running in CI?")
8+
$(eval GITHUB_WORKSPACE = $(PWD))
9+
endif
10+
$(GITHUB_WORKSPACE)/bin/monetr database migrate -d $(POSTGRES_DB) -U $(POSTGRES_USER) -H $(POSTGRES_HOST)

Makefile.ci Makefile.gitlab-ci

File renamed without changes.

Makefile.tinker

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
tinker-docs:
3+
docker rm tinker-docs || true
4+
docker run -it \
5+
--name tinker-docs \
6+
--mount type=bind,source="$(PWD)/",target=/build/monetr/rest-api \
7+
containers.monetr.dev/ubuntu:20.04 \
8+
/bin/bash

0 commit comments

Comments
 (0)