-
Notifications
You must be signed in to change notification settings - Fork 22
65 lines (53 loc) · 1.99 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
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:
- uses: actions/checkout@v2
- uses: browser-actions/setup-chrome@v1
with:
install-chromedriver: true
- 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: run RSpec tests and capture coverage
run: |
bundle exec rspec
$CCTR format-coverage --output coverage/codeclimate.$SUITE.json --input-type simplecov
- name: run Cucumber tests and capture coverage
run: |
bundle exec cucumber --retry 2 2>/dev/null
$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 }}