-
-
Notifications
You must be signed in to change notification settings - Fork 11
126 lines (122 loc) · 4.03 KB
/
test.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Rubocop
run: bundle exec rubocop --color
rspec:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2"]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: RSpec
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: c782e3e534f6aac1bb5a0d595723167ed145d03567242c2ce848ef46ba36672a
COVERAGE: "true"
ALLURE_ENVIRONMENT: ruby-${{ matrix.ruby }}
with:
coverageCommand: bundle exec rspec --force-color
coverageLocations: coverage/coverage.json:simplecov
- uses: actions/upload-artifact@v3
if: always()
with:
name: allure-reports
path: reports/allure-results/
retention-days: 1
publish-report:
runs-on: ubuntu-latest
needs: rspec
if: always()
name: Publish report to ${{ matrix.provider }}
strategy:
fail-fast: false
matrix:
include:
- provider: gcs
bucket: allure-test-reports
table: markdown
results: actions
- provider: s3
bucket: allure-tests-reports
table: ascii
results: description
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Build
uses: docker/build-push-action@v5.0.0
with:
context: .
push: false
load: true
tags: publisher:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Download allure reports
uses: actions/download-artifact@v3
with:
name: allure-reports
path: reports/allure-results
- name: Publish allure report
env:
GOOGLE_CLOUD_CREDENTIALS_JSON: ${{ secrets.GOOGLE_CLOUD_CREDENTIALS_JSON }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker run --rm \
-v "$(pwd)":/workspace \
-v "$GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH" \
-v "$GITHUB_STEP_SUMMARY:$GITHUB_STEP_SUMMARY" \
-e GITHUB_WORKFLOW="$GITHUB_WORKFLOW" \
-e GITHUB_EVENT_NAME="$GITHUB_EVENT_NAME" \
-e GITHUB_EVENT_PATH="$GITHUB_EVENT_PATH" \
-e GITHUB_SERVER_URL="$GITHUB_SERVER_URL" \
-e GITHUB_API_URL="$GITHUB_API_URL" \
-e GITHUB_REPOSITORY="$GITHUB_REPOSITORY" \
-e GITHUB_RUN_ID="$GITHUB_RUN_ID" \
-e GITHUB_AUTH_TOKEN="$GITHUB_AUTH_TOKEN" \
-e GITHUB_SHA="$GITHUB_SHA" \
-e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" \
-e GOOGLE_CLOUD_CREDENTIALS_JSON="$GOOGLE_CLOUD_CREDENTIALS_JSON" \
-e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
-e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \
-e ALLURE_JOB_NAME="rspec" \
publisher:latest \
upload ${{ matrix.provider }} \
--results-glob="/workspace/reports/allure-results" \
--bucket="${{ matrix.bucket }}" \
--prefix="allure-report-publisher/$GITHUB_REF" \
--update-pr="${{ matrix.results }}" \
--summary="behaviors" \
--summary-table-type="${{ matrix.table }}" \
--copy-latest \
--color \
--debug