forked from newrelic/newrelic-lambda-layers
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.72 KB
/
publish-node.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
name: Publish Node Layers
on:
push:
tags:
- v**_nodejs
jobs:
publish-node:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18, 20]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Check Tag
id: node-check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+(\.[0-9]+)*_nodejs$ ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
- name: Run Node ${{ matrix.node-version }} unit tests
if: steps.node-check-tag.outputs.match == 'true'
run: cd nodejs && npm ci && npm run test
- name: Publish layer
if: steps.node-check-tag.outputs.match == 'true'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: make publish-nodejs${{ matrix.node-version }}x-ci
- name: Publish ECR image for nodejs${{ matrix.node-version }}
if: steps.node-check-tag.outputs.match == 'true'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd nodejs
./publish-layers.sh build-publish-nodejs${{ matrix.node-version }}x-ecr-image
- name: Upload Unit Test Coverage
if: steps.node-check-tag.outputs.match == 'true'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./nodejs/coverage/unit/lcov.info
fail_ci_if_error: false
flags: unit-tests