-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (81 loc) · 2.19 KB
/
continuous-integration.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
# TODO: Enable GitHub Actions on the repository to test all pull requests
# https://github.com/<org>/<repo>/actions
name: CI Checks
on:
pull_request:
push:
branches:
- main
- develop
jobs:
lint-and-format:
name: Lint and format application
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Build and cache
uses: ./.github/actions/continuous-integration/load-cache
-
name: Run Ruby standard
run: |
docker run --rm app_test:latest /bin/bash -c "bundle exec standardrb -f simple"
-
name: Run ESLint
run: |
docker run --rm app_test:latest /bin/bash -c "yarn run lint:js"
-
name: Run Stylelint
run: |
docker run --rm app_test:latest /bin/bash -c "yarn run lint:css"
-
name: Run Prettier
run: |
docker run --rm app_test:latest /bin/bash -c "yarn run lint:format"
static-analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Build and cache
uses: ./.github/actions/continuous-integration/load-cache
-
name: Run Brakeman
run: |
docker run --rm app_test:latest /bin/bash -c "bundle exec brakeman -o /dev/stdout"
specs:
name: Specs and coverage
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Build and cache
uses: ./.github/actions/continuous-integration/load-cache
-
name: Run RSpec and Simplecov
run: |
docker compose -p complete-app -f docker-compose.ci.yml \
run --name app_test test /bin/bash -c "bin/rails spec"
-
name: Shutdown containers
run: docker compose -p app_test down && docker compose -p app_test rm
shellcheck:
name: Lint scripts
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Run Shellceck
run: |
for file in $(git ls-files script/*)
do shellcheck -x "$file"
done