-
-
Notifications
You must be signed in to change notification settings - Fork 11
141 lines (137 loc) · 4.36 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.6
- name: Set up Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Rubocop
run: bundle exec rubocop --color
rspec:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3"]
steps:
- name: Checkout
uses: actions/checkout@v4.1.6
- 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@v9.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@v4
if: always()
with:
name: allure-reports-${{ matrix.ruby }}
path: reports/allure-results/
retention-days: 1
publish-report:
runs-on: ubuntu-latest
needs: rspec
if: always()
name: publish report as ${{ matrix.results }}
strategy:
fail-fast: false
matrix:
include:
- table: markdown
results: description
- table: ascii
results: comment
- table: markdown
results: actions
steps:
- name: Checkout
uses: actions/checkout@v4.1.6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.7.1
- name: Build
uses: docker/build-push-action@v6.10.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@v4
with:
path: reports/allure-results
- name: Cache minio store
id: cache-primes-restore
uses: actions/cache@v4
with:
path: minio
key: minio/${{ github.ref_name }}/${{ github.run_id }}
restore-keys: minio/${{ github.ref_name }}
- name: Set up Minio
run: |
mkdir -p minio/allure-reports
docker network create allure
docker run -d \
--name minio \
--network allure \
--volume "$(pwd)/minio":/data \
quay.io/minio/minio:latest \
server /data
- name: Publish allure report
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker run --rm \
-v "$(pwd)":/workspace \
-v "$GITHUB_STEP_SUMMARY:$GITHUB_STEP_SUMMARY" \
-v "$GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH" \
-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_SHA="$GITHUB_SHA" \
-e GITHUB_AUTH_TOKEN="$GITHUB_AUTH_TOKEN" \
-e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" \
-e AWS_ENDPOINT="http://minio:9000" \
-e AWS_FORCE_PATH_STYLE="true" \
-e AWS_ACCESS_KEY_ID="minioadmin" \
-e AWS_SECRET_ACCESS_KEY="minioadmin" \
-e ALLURE_JOB_NAME="rspec" \
--network allure \
publisher:latest \
upload s3 \
--results-glob="/workspace/reports/allure-results/*" \
--bucket="allure-reports" \
--prefix="allure-report-publisher/$GITHUB_REF" \
--update-pr="${{ matrix.results }}" \
--summary="behaviors" \
--summary-table-type="${{ matrix.table }}" \
--report-title="Test Report" \
--report-name="Test Report" \
--copy-latest \
--color \
--debug