forked from IntersectMBO/cardano-node-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (113 loc) · 3.98 KB
/
upgrade_reusable.yaml
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
name: Node upgrade tests reusable
on:
workflow_call:
inputs:
env-path:
required: true
type: string
secrets:
GH_TOKEN:
required: true
CI_FAIL_MAILS:
required: false
GMAIL_USERNAME:
required: false
GMAIL_PASSWORD:
required: false
env:
CI_FAIL_MAILS: ${{ secrets.CI_FAIL_MAILS }}
jobs:
reusable_run:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GH_TOKEN }}
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=
substituters = https://cache.nixos.org https://cache.iog.io https://iohk.cachix.org
allow-import-from-derivation = true
- name: Collect env variables
run: |
: > .github_ci_env
echo "PY_COLORS=1" >> .github_ci_env
cat "${{ inputs.env-path }}" >> .github_ci_env
- name: Export env variables
run: |
cat .github_ci_env
cat .github_ci_env >> $GITHUB_ENV
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> $GITHUB_ENV
- name: ▶️ Run Upgrade Tests
id: testing-step
run: |
# env
echo "::group::Script setup"
./.github/node_upgrade.sh
echo "::endgroup::"
- name: ↟ Upload testing artifacts on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: testing-artifacts
path: testing_artifacts.tar.xz
- name: ↟ Upload Allure results for step1
uses: actions/upload-artifact@v4
# When using `always()`, you lose ability to manually cancel the workflow.
# Use `success() || failure()` instead.
if: success() || failure()
with:
name: allure-results-step1
path: allure-results-step1.tar.xz
- name: ↟ Upload Allure results for step2
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: allure-results-step2
path: allure-results-step2.tar.xz
- name: ↟ Upload Allure results for step3
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: allure-results-step3
path: allure-results-step3.tar.xz
- name: ↟ Upload HTML reports
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: testrun-reports
path: |
testrun-report-step1.html
testrun-report-step2.html
testrun-report-step3.html
- name: ↟ Upload testrun files
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: testrun-files
path: |
scheduling.log.xz
errors_all.log
- name: ↟ Upload CLI coverage
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: cli-coverage
path: cli_coverage.json
- name: ✉ Mail failure report
uses: dawidd6/action-send-mail@v4
if: (success() || failure()) && steps.testing-step.outcome != 'success' && env.CI_FAIL_MAILS
with:
server_address: smtp.gmail.com
server_port: 465
secure: true
username: ${{secrets.GMAIL_USERNAME}}
password: ${{secrets.GMAIL_PASSWORD}}
subject: "Status: ${{ steps.testing-step.outcome }}; workflow: ${{ github.workflow }}"
to: ${{secrets.CI_FAIL_MAILS}}
from: Cardano Github Actions
body: "Run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
reply_to: noreply@github.com
attachments: testrun-report.html