-
Notifications
You must be signed in to change notification settings - Fork 12
84 lines (80 loc) · 2.62 KB
/
flow.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
name: Flow
on:
push:
branches: [ master ]
tags: [ v* ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: latest
- name: Install dependencies
run: make prepare
- name: Run Tests
run: make clj-test java-test
coverage:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: latest
- name: Coverage
run: make coverage
- name: Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./target/coverage/codecov.json
clojars_push:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: latest
- name: Create jar and pom files
run: |
make prepare jar
cp ./target/classes/META-INF/maven/io.github.erdos/stencil-core/pom.xml ./pom.xml
cp ./target/stencil-core-*.jar ./stencil-core.jar
- name: Release Clojars
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USER }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASS }}
run: clojure -X:deploy || echo skipping
docker_push:
needs: clojars_push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env vars
run: |
IMAGE_ID=ghcr.io/erdos/stencil
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo TAG=$IMAGE_ID:$VERSION >> $GITHUB_ENV
- name: Log into GitHub Container Registry
run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build GraalVM image
working-directory: service
run: docker build . --file Dockerfile.graalvm --tag ${{ env.TAG }}-graal
- name: Push GraalVM image to GitHub Container Registry
run: docker push ${{ env.TAG }}-graal
- name: Build image
working-directory: service
run: docker build . --file Dockerfile --tag ${{ env.TAG }}
- name: Push image to GitHub Container Registry
run: docker push ${{ env.TAG }}