-
Notifications
You must be signed in to change notification settings - Fork 35
103 lines (85 loc) · 2.73 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
96
97
98
99
100
101
102
103
name: CI
on:
workflow_dispatch: {}
push:
branches:
- main
paths-ignore:
- "Jenkinsfile"
- ".git**"
pull_request:
jobs:
snyk-security:
name: SNYK security analysis
uses: alphagov/govuk-infrastructure/.github/workflows/snyk-security.yml@main
secrets: inherit
codeql-sast:
name: CodeQL SAST scan
uses: alphagov/govuk-infrastructure/.github/workflows/codeql-analysis.yml@main
permissions:
security-events: write
dependency-review:
name: Dependency Review scan
uses: alphagov/govuk-infrastructure/.github/workflows/dependency-review.yml@main
security-analysis:
name: Security Analysis
uses: alphagov/govuk-infrastructure/.github/workflows/brakeman.yml@main
lint-scss:
name: Lint SCSS
uses: alphagov/govuk-infrastructure/.github/workflows/stylelint.yml@main
with:
files: "app/assets/stylesheets/"
lint-javascript:
name: Lint JavaScript
uses: alphagov/govuk-infrastructure/.github/workflows/standardx.yml@main
with:
files: "'app/assets/javascripts/**/*.js' 'spec/javascripts/**/*.js'"
lint-ruby:
name: Lint Ruby
uses: alphagov/govuk-infrastructure/.github/workflows/rubocop.yml@main
test-javascript:
name: Test JavaScript
uses: alphagov/govuk-infrastructure/.github/workflows/jasmine.yml@main
with:
useWithRails: true
test-ruby-matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ci_node_total: [4]
ci_node_index: [0, 1, 2, 3]
steps:
- name: Setup MySQL
id: setup-mysql
uses: alphagov/govuk-infrastructure/.github/actions/setup-mysql@main
- name: Setup Redis
uses: alphagov/govuk-infrastructure/.github/actions/setup-redis@main
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup Node
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@main
- name: Precompile assets
uses: alphagov/govuk-infrastructure/.github/actions/precompile-rails-assets@main
- name: Initialize database
env:
RAILS_ENV: test
TEST_DATABASE_URL: ${{ steps.setup-mysql.outputs.db-url }}
run: bundle exec rails db:setup
- name: Run Minitest
env:
RAILS_ENV: test
TEST_DATABASE_URL: ${{ steps.setup-mysql.outputs.db-url }}
CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
CI_NODE_INDEX: ${{ matrix.ci_node_index }}
run: ./script/minitest-ci
test-ruby:
name: Test Ruby
needs: test-ruby-matrix
runs-on: ubuntu-latest
steps:
- run: echo "All Minitest tests have passed 🚀"