-
Notifications
You must be signed in to change notification settings - Fork 7
131 lines (113 loc) · 4.22 KB
/
nightly-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
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
name: CI nightly
on:
schedule:
- cron: '0 0 * * *' # Runs every day at 00:00
workflow_dispatch:
permissions:
id-token: write
contents: write
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
AWS_REGION: eu-central-1
AWS_ROLE_ARN: arn:aws:iam::332405224602:role/ci
EARTHLY_TARGET: docker
ECR_REGISTRY: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
REPORT_EXT: .junit-report.xml
ALLURE_REPORT_PATH: nightly-allure-report
jobs:
ci_nightly:
uses: input-output-hk/catalyst-ci/.github/workflows/ci.yml@master
with:
aws_ecr_registry: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
aws_role_arn: arn:aws:iam::332405224602:role/ci
aws_region: eu-central-1
nightly: true
secrets:
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
earthly_runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
generate-test-reports:
name: Generate test reports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup CI
uses: input-output-hk/catalyst-ci/actions/setup@master
with:
aws_role_arn: ${{ env.AWS_ROLE_ARN }}
aws_region: ${{ env.AWS_REGION }}
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
- name: Get python api test report
uses: input-output-hk/catalyst-ci/actions/run@master
if: always()
continue-on-error: true
with:
earthfile: ./catalyst-gateway/tests/api_tests/
flags: --allow-privileged
targets: nightly-test
target_flags:
runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
artifact: "false"
- name: Get cardano wallet integration test report
uses: input-output-hk/catalyst-ci/actions/run@master
if: always()
continue-on-error: true
with:
earthfile: ./catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/
flags: --allow-privileged
targets: nightly-test
target_flags:
runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
artifact: "false"
- name: Collect and upload test reports
uses: actions/upload-artifact@v4
if: always()
with:
path: '**/*${{ env.REPORT_EXT }}'
if-no-files-found: error
retention-days: 1
generate-allure-report:
name: Generate allure report
runs-on: ubuntu-latest
needs: [generate-test-reports]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Setup Allure report
run: |
mkdir -p ${{ env.ALLURE_REPORT_PATH }}
shopt -s globstar
cp **/*${{ env.REPORT_EXT }} ${{ env.ALLURE_REPORT_PATH }}
ls ${{ env.ALLURE_REPORT_PATH }}
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages-dir
- name: Build Allure report
uses: mgrybyk/allure-report-branch-action@v1
id: allure
with:
report_id: 'nightly-test-report'
gh_pages: 'gh-pages-dir'
report_dir: ${{ env.ALLURE_REPORT_PATH }}
- name: Git push to gh-pages
uses: mgrybyk/git-commit-pull-push-action@v1
with:
repository: gh-pages-dir
branch: gh-pages
pull_args: --rebase -X ours
- name: Send Slack notification
if: ${{ always() && steps.allure.outputs.report_url }}
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"text": ":rocket: *Test Report*\n<${{ steps.allure.outputs.report_url }}|Click here to view the Allure report>\n*Passed:* ${{ steps.allure.outputs.test_result_passed }}/ ${{ steps.allure.outputs.test_result_total }}\n*Failed:* ${{ steps.allure.outputs.test_result_failed }}/ ${{ steps.allure.outputs.test_result_total }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}