Repository navigation
102 lines (90 loc) · 3.7 KB
/
Copy pathruby.yml
File metadata and controls
102 lines (90 loc) · 3.7 KB
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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
rspec:
# Pinned until the move to the new server; revisit then (#1610)
runs-on: ubuntu-24.04
env:
GITHUB_APP_ID: xxxxxx
GITHUB_APP_NAME: xxxxxxxxxx
GITHUB_APP_CLIENT_ID: xxxxxxxxxxxxxxxxxxxx
GITHUB_APP_CLIENT_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ELASTICSEARCH_URL: http://127.0.0.1:9288
# WARNING: Don't use this SECRET_KEY_BASE anywhere else!!
SECRET_KEY_BASE: c788cda5c584f5f4746b5f133dbc10e1fe0c718692358f27ef44cc45b8df4709c999771adb3254ac91b06001851aa0f4a5fa9b5ba44482c7406b6f709e715f37
DIGITAL_OCEAN_CLIENT_ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DIGITAL_OCEAN_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Secret for authenticating sync / faye
SYNC_AUTH_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Secret for single sign on authentication for Discourse
DISCOURSE_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxx
DISCOURSE_URL: http://discuss.dev.morph.io
# Used by mitmproxy to communicate via the api back to morph
MITMPROXY_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxx
MORPH_URL: http://localhost:5100
# Error reporting to Honeybadger
HONEYBADGER_API_KEY: xxxxxxxx
# We're using postal to send mail
SMTP_USERNAME: xxxxxxx
SMTP_PASSWORD: xxxxxxxxxxxxxxxxxxxx
# Stripe payment processor
STRIPE_PUBLISHABLE_KEY: pk_test_xxxxxxxxxxxxxxxxxxxxxxxx
STRIPE_SECRET_KEY: sk_test_xxxxxxxxxxxxxxxxxxxxxxxx
RAILS_ENV: test
DB_DATABASE: scraping_test
DB_USER: scraping
DB_PASSWORD: password
steps:
- name: Checkout this repo
uses: actions/checkout@v4
- name: configure rails database
run: cp config/database-ci.yml config/database.yml
- name: Set up MySQL
run: |
set -euv
sudo /etc/init.d/mysql start
echo
echo "Creating database"
sudo mysql -proot -e "CREATE DATABASE ${{ env.DB_DATABASE }};"
echo
echo "Creating database user"
sudo mysql -proot -e "CREATE USER '${{ env.DB_USER }}'@'localhost' IDENTIFIED BY '${{ env.DB_PASSWORD }}';"
echo
echo "Granting powers to db users"
sudo mysql -proot -e "GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD, INDEX on *.* TO '${{ env.DB_USER }}'@'localhost' WITH GRANT OPTION;"
echo
mysqladmin ping --user=${{ env.DB_USER }} --password=${{ env.DB_PASSWORD }} --port 3306 --host localhost
- name: Start elasticsearch and redis Services
run: make ci-services-up
- name: Install Ruby (version given by .ruby-version) and Bundler
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: "pull OpenAustralia docker images"
run: docker pull openaustralia/buildstep:latest
- name: Prepare database for testing
run: bundle exec rails db:create db:migrate
- name: Run rspec
run: DONT_RUN_DOCKER_TESTS=1 RUN_SLOW_TESTS=1 DONT_RUN_GITHUB_TESTS=1 bundle exec rspec spec -fd
- uses: qltysh/qlty-action/coverage@v1
with:
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
files: coverage/coverage.json
lint:
# Pinned until the move to the new server; revisit then (#1610)
runs-on: ubuntu-24.04
steps:
- name: Checkout this repo
uses: actions/checkout@v4
- name: Install Ruby (version given by .ruby-version) and Bundler
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Rubocop
run: bundle exec rubocop
- name: Haml Lint
run: bundle exec haml-lint