generated from mrtousif/reddit-clone
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (78 loc) · 2.97 KB
/
ci.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
name: CI
on:
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 12
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Install Task
uses: arduino/setup-task@v1
- uses: pnpm/action-setup@v2.2.4
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v6
with:
strip_tag_prefix: false
- name: Install dependencies
run: pnpm install
- name: Lint, test and build (pull request)
if: ${{ github.event_name == 'pull_request' }}
run: pnpm turbo run build --filter={./apps/*}[HEAD^1] --filter={./packages/*}[HEAD^1]
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v2
with:
files: "**/reports/jest-*.xml"
- name: Test Report
uses: dorny/test-reporter@v1
if: steps.check_files.outputs.files_exists == 'true'
with:
name: JEST Tests
path: '**/reports/jest-*.xml'
reporter: jest-junit
- name: Danger
run: pnpm danger ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: EndBug/add-and-commit@v9
with:
default_author: github_actor
- name: Detect Secrets
uses: trufflesecurity/trufflehog@v3.6.7
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
- name: Get changed files in the docs folder
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
hasura:
- 'apps/hasura/metadata/**.yaml'
# - name: Detect Hasura metadata changes
# uses: Fieldguide/action-hasura-change-summary@v2
# if: steps.changes.outputs.hasura == 'true'
# id: hasura-change-summary
# with:
# hasura_endpoint: https://my-pr-${{ github.event.number }}-app.example.com
# - name: Create or update summary comment
# uses: marocchino/sticky-pull-request-comment@v2
# if: steps.hasura-change-summary.outputs.change_html
# with:
# header: hasura-change-summary
# message: ${{ steps.hasura-change-summary.outputs.change_html }}