-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (83 loc) · 2.42 KB
/
ci_cleaner.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
name: "CI/CD"
on: [push]
env:
CI: "true"
CODECOV: "true"
RUBY_VERSION: 3.0.2
NODE_VERSION: 16.9.1
WEBPACKER_RUNTIME_COMPILE: "false"
RAILS_ENV: test
jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: rokroskar/[email protected]
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: OpenSourcePolitics/lint-action@master
tests:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:11
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
steps:
- uses: rokroskar/[email protected]
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: OpenSourcePolitics/rspec-action@master
with:
command: "bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'"
system_tests:
name: System tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:11
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
steps:
- uses: rokroskar/[email protected]
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: OpenSourcePolitics/rspec-action@master
with:
command: "bundle exec rspec spec/system"
publish:
if: "github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release' )"
needs: [tests, system_tests, lint]
runs-on: ubuntu-latest
steps:
- uses: OpenSourcePolitics/publish-gem-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}