forked from ManifoldScholar/manifold
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (76 loc) · 2.39 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
env:
BROWSERSLIST_IGNORE_OLD_DATA: beQuiet
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/manifold_test"
DISABLE_SPRING: yes
ELASTICSEARCH_URL: "http://localhost:9200"
PATH: /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/sbin
RAILS_ENV: test
jobs:
client-lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- name: "Lint client"
working-directory: "./client"
run: yarn lint
client-tests:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- name: "Run client tests"
working-directory: "./client"
run: yarn test-ci
api-lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
- uses: ./.github/actions/setup-ruby
- name: "Run Rubopcop"
working-directory: "./api"
run: bin/rubocop
api-tests:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.12-alpine
ports: ["5432:5432"]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: manifold_test
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:6.2.7-alpine
ports: ["6379:6379"]
options: --entrypoint redis-server
steps:
- name: "Checkout code"
uses: actions/checkout@v3
- uses: ./.github/actions/setup-ruby
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-elasticsearch
- name: "Install Pandoc"
run: |
wget https://github.com/jgm/pandoc/releases/download/2.2/pandoc-2.2-1-amd64.deb
sudo dpkg -i pandoc-2.2-1-amd64.deb
- name: "Setup test database"
working-directory: "./api"
run: bin/rails db:setup
- name: "Run API specs"
working-directory: "./api"
run: bin/rspec spec --tag="~integration" --tag="~slow"