1+ name : ' Run node-redis tests'
2+ description : ' Runs node-redis tests against different Redis versions and configurations'
3+ inputs :
4+ repository :
5+ description : ' Repository to checkout'
6+ required : false
7+ ref :
8+ description : ' Branch to checkout'
9+ required : false
10+ node-version :
11+ description : ' Node version to use for running tests'
12+ required : true
13+ redis-tag :
14+ description : ' Redis image tag'
15+ required : false
16+ redis-version :
17+ description : ' Redis version to test against'
18+ required : false
19+ otel-authorization-token :
20+ description : ' Authorization token for OTEL metrics reporting'
21+ required : false
22+ run-codecov :
23+ description : ' Whether to upload coverage to Codecov'
24+ required : false
25+ default : ' true'
26+ runs :
27+ using : " composite"
28+ steps :
29+ - uses : actions/checkout@v4
30+ with :
31+ repository : ${{ inputs.repository }}
32+ ref : ${{ inputs.ref }}
33+ fetch-depth : 1
34+ - name : Use Node.js ${{ inputs.node-version }}
35+ uses : actions/setup-node@v4
36+ with :
37+ node-version : ${{ inputs.node-version }}
38+ - name : Update npm
39+ shell : bash
40+ run : npm i -g npm
41+ if : ${{ inputs.node-version <= 14 }}
42+ - name : Install Packages
43+ shell : bash
44+ run : npm ci
45+ - name : Build
46+ shell : bash
47+ run : npm run build
48+ - name : Run Tests
49+ shell : bash
50+ run : npm run test -ws --if-present -- --forbid-only --redis-tag=${{ inputs.redis-tag }} --redis-version=${{ inputs.redis-version }}
51+ - name : Upload to Codecov
52+ if : inputs.run-codecov == 'true'
53+ shell : bash
54+ run : |
55+ curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
56+ curl -Os https://uploader.codecov.io/latest/linux/codecov
57+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
58+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
59+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
60+ shasum -a 256 -c codecov.SHA256SUM
61+ chmod +x codecov
62+ ./codecov
63+ - name : Self Report Metrics
64+ if : (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && inputs.otel-authorization-token != ''
65+ id : self-report-metrics
66+ uses : redis-developer/cae-otel-ci-visibility@v2
67+ with :
68+ junit-xml-folder : " junit-results"
69+ otlp-endpoint : " https://otlp-gateway-prod-us-central-0.grafana.net/otlp/v1/metrics"
70+ otlp-headers : " Authorization=Basic ${{inputs.otel-authorization-token}}"
71+ env :
72+ OTEL_EXPORTER_OTLP_PROTOCOL : " http/protobuf"
73+ ACTIONS_STEP_DEBUG : " true"
0 commit comments