-
Notifications
You must be signed in to change notification settings - Fork 4
136 lines (109 loc) · 3.53 KB
/
pull-request.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
# kics-scan ignore
name: Pull Request CI
defaults:
run:
shell: bash
concurrency:
group: ${{ github.head_ref }}${{ github.ref }}
cancel-in-progress: true
env:
JAVA_VERSION: 17
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
on:
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
os-type: linux
- os: macos-13
os-type: macos
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: "Validate Gradle Wrapper"
run: pwd
- name: "Checkout the repo"
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
fetch-depth: 0
- name: "Install Java ${{ env.JAVA_VERSION }}"
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "zulu"
- name: "Gradle Build Action"
uses: gradle/gradle-build-action@v3
- name: "Install Homebrew"
if: matrix.os-type == 'macos'
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: "Install Docker"
if: matrix.os-type == 'macos'
run: |
brew install colima docker
- name: "Open Docker"
if: matrix.os-type == 'macos'
run: |
colima start
- name: Wait for Docker
run: sleep 10
- name: Test Docker
run: docker version -f '{{ .Server.Os }}'
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
- name: "Install autoconf, automake, libtool"
if: matrix.os-type == 'macos'
run: |
brew install autoconf automake libtool
- uses: maxim-lobanov/setup-xcode@v1
if: matrix.os-type == 'macos'
with:
xcode-version: '15.0.1'
- name: "Install rust toolchain (Linux)"
if: matrix.os-type == 'linux'
run: sudo apt install rustc build-essential -y
- name: "Install rust toolchain (Macos)"
if: matrix.os-type == 'macos'
run: brew install rustup
- name: "Install wasm-pack"
run: cargo install wasm-pack
- name: "Install Cross"
if: matrix.os-type == 'macos'
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: "Test Kotlin code is properly formatted"
run: ./gradlew ktlintCheck
- name: "Build Check All tests"
run: ./gradlew allTests
- name: "Generate kover coverage report"
run: ./gradlew koverHtmlReport koverXmlReport
- name: "Upload coverage html"
uses: actions/upload-artifact@v3.1.2
with:
name: coverage-results-${{ matrix.os-type }}.zip
path: apollo/build/reports/kover/html
- name: "Add coverage report to PR"
id: kover
uses: mi-kas/kover-report@v1
with:
path: ${{ github.workspace }}/apollo/build/reports/kover/report.xml
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
title: Code Coverage
update-comment: true
min-coverage-overall: 90
min-coverage-changed-files: 90
coverage-counter-type: LINE
- name: "Upload the build report"
if: always()
uses: actions/upload-artifact@v3
with:
path: "**/build/reports/"
name: report-${{ matrix.os-type }}