-
Notifications
You must be signed in to change notification settings - Fork 22
73 lines (61 loc) · 2.37 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
name: build
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
env:
CCTR: ./cc-test-reporter
BUNDLE_WITHOUT: production
BUNDLE_BUILD__NOKOGIRI: --use-system-libraries
TZ: America/Los_Angeles
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: install libxslt
run: |
sudo apt-get install -y libxslt-dev
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
bundler-cache: false
- name: create test database and secrets file
run: |
gpg --pinentry-mode loopback --batch --passphrase "${{ secrets.GPG_SYMMETRIC_KEY }}" -d -o config/application.yml config/application.yml.asc
cp config/database.yml.test config/database.yml
- name: Setup CodeClimate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $CCTR
chmod +x $CCTR
$CCTR before-build
- name: install gems
run: |
bundle install --without production
- name: Install Chrome For Testing and Chromedriver
uses: browser-actions/setup-chrome@v1
id: install-chromedriver
with:
chrome-version: stable
install-chromedriver: true
install-dependencies: true
- name: run Cucumber tests and capture coverage
env:
GITHUB_ACTIONS_CHROMEDRIVER_PATH: ${{ steps.install-chromedriver.outputs.chromedriver-path }}
GITHUB_ACTIONS_CHROME_FOR_TESTING_PATH: ${{ steps.install-chromedriver.outputs.chrome-path }}
run: |
bundle exec cucumber --retry 2 2>/dev/null
$CCTR format-coverage --output coverage/codeclimate.$SUITE.json --input-type simplecov
- name: run RSpec tests and capture coverage
run: |
bundle exec rspec
$CCTR format-coverage --output coverage/codeclimate.$SUITE.json --input-type simplecov
- name: Publish code coverage
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
$CCTR sum-coverage coverage/codeclimate.*.json
$CCTR upload-coverage --id ${{ secrets.CC_TEST_REPORTER_ID }}
$CCTR after-build --id ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}