-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (85 loc) · 2.92 KB
/
build.yml
File metadata and controls
100 lines (85 loc) · 2.92 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
name: CI
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]
types: [ 'opened', 'reopened', 'edited', 'synchronize' ]
workflow_dispatch:
permissions:
contents: read
jobs:
cancel_previous:
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa #v0.12.1
with:
workflow_id: ${{ github.event.workflow.id }}
braze-test:
needs: cancel_previous
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- name: Checkout source branch
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-core-
- name: Run Tests
run: ./gradlew braze:test
- name: Generate coverage report
run: ./gradlew braze:codeCoverageReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574
# android-test:
# needs: cancel_previous
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
# - name: cache gradle dependencies
# uses: actions/cache@v2
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-android-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-android-
# - name: Run Tests
# run: ./gradlew android:test
# - name: Generate coverage report
# run: ./gradlew android:codeCoverageReport
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v2
# security:
# needs: cancel_previous
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
# - name: Snyk
# run: ./gradlew snyk-test
# env:
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}