-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (104 loc) · 4.05 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
name: Build
on:
pull_request:
branches: [main]
jobs:
build-app:
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: build
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build docker image
uses: docker/build-push-action@v2
with:
context: app
load: true
cache-from: type=gha,scope=app
cache-to: type=gha,mode=max,scope=app
- name: Build testable docker image
uses: docker/build-push-action@v2
with:
context: app
load: true
cache-from: type=gha,scope=app
cache-to: type=gha,mode=max,scope=app
tags: ${{ env.DOCKER_IMAGE }}
target: build
- name: Run linting
run: |
docker run --name lint $DOCKER_IMAGE npm run lint -- --output-file lint-results.json --output-file-format annotations
docker cp lint:/app/lint-results.json ./app/lint-results.json
- name: Upload linting results
uses: kibalabs/github-action-create-annotations@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
json-file-path: ./app/lint-results.json
check-name: lint-app
fail-on-error: false
path-prefix: ./app/
- name: Run typing
run: |
docker run --name typing $DOCKER_IMAGE npm run type-check -- --output-file typing-results.json --output-file-format annotations
docker cp typing:/app/typing-results.json ./app/typing-results.json
- name: Upload typing results
uses: kibalabs/github-action-create-annotations@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
json-file-path: ./app/typing-results.json
check-name: type-app
fail-on-error: false
path-prefix: ./app/
build-api:
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: build
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build docker image
uses: docker/build-push-action@v2
with:
context: api
load: true
cache-from: type=gha,scope=api
cache-to: type=gha,mode=max,scope=api
tags: ${{ env.DOCKER_IMAGE }}
- name: Run lint
run: |
docker run --name lint $DOCKER_IMAGE lint --directory web3images --output-file lint-results.json --output-format annotations
docker cp lint:/app/lint-results.json ./api/lint-results.json
- name: Upload lint results
uses: kibalabs/github-action-create-annotations@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
json-file-path: ./api/lint-results.json
check-name: lint-api
fail-on-error: false
# - name: Run type-check
# run: |
# docker run --name type-check $DOCKER_IMAGE type-check --directory web3images --output-file type-check-results.json --output-format annotations
# docker cp type-check:/app/type-check-results.json ./api/type-check-results.json
# - name: Upload type-check results
# uses: kibalabs/github-action-create-annotations@main
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# json-file-path: ./api/type-check-results.json
# check-name: type-check-api
# fail-on-error: false
- name: Run security-check
run: |
docker run --name security-check $DOCKER_IMAGE security-check --directory web3images --output-file security-check-results.json --output-format annotations
docker cp security-check:/app/security-check-results.json ./api/security-check-results.json
- name: Upload security-check results
uses: kibalabs/github-action-create-annotations@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
json-file-path: ./api/security-check-results.json
check-name: security-check-api
fail-on-error: false