Skip to content

Added e2e tests for Node #5

Added e2e tests for Node

Added e2e tests for Node #5

Workflow file for this run

# Copyright 2010 New Relic, Inc.

Check failure on line 1 in .github/workflows/nodejs.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/nodejs.yml

Invalid workflow file

No steps defined in `steps` and no workflow called in `uses` for the following jobs: set-agent-version
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
name: "NodeJs Init Container CI"
on:
pull_request:
paths:
- 'src/nodejs/**'
- '.github/workflows/nodejs.yml'
push:
paths:
- 'nodejs/**'
- '.github/workflows/nodejs.yml'
branches:
- main
# Do not run when a tag is created.
tags-ignore:
- "**"
release:
types:
- published
workflow_dispatch:
env:
INITCONTAINER_LANGUAGE: nodejs
K8S_OPERATOR_IMAGE_TAG: edge
jobs:
set-agent-version:
if: github.event_name == 'release' && endsWith(github.ref, '_nodejs') # Skip everything if this isn't Node
runs-on: ubuntu-latest
call-test:
uses: ./.github/workflows/test.yml
with:
RUNTIME_VERSION: ${{ matrix.node-version }}
call-publish:
runs-on: ubuntu-latest
needs:
- set-agent-version
- call-test
strategy:
fail-fast: false
matrix:
node-version: [16, 18, 20]
agent-version: ['latest']
steps:
- uses: actions/setup-node@v4
with:
INITCONTAINER_LANGUAGE: ${{ env.INITCONTAINER_LANGUAGE }}
K8S_OPERATOR_IMAGE_TAG: ${{ env.K8S_OPERATOR_IMAGE_TAG }}
RUNTIME_VERSION: ${{ matrix.node-version }}
- name: Get agent version
run: |
if [[ ${{ matrix.agent-version }} == 'latest' ]]; then
cd nodejs && npm i newrelic@${{ matrix.agent-version }} && cd ..
echo AGENT_VERSION=$(cat nodejs/package.json | jq -r '.dependencies."newrelic"') >> $GITHUB_ENV
elif
echo AGENT_VERSION=${{ matrix.agent-version }} >> $GITHUB_ENV
fi
- name: Format Agent Version
id: version
run: |
agent_version=${{ env.AGENT_VERSION }} # Use output
echo NEW_RELIC_AGENT_VERSION=${{ env.AGENT_VERSION }} >> $GITHUB_ENV # Make ure to send the agent version to the dockerfile
agent_version=${agent_version##v} # Remove v prefix
agent_version=${agent_version%%_${{ env.INITCONTAINER_LANGUAGE }}} # Remove language suffix
agent_version=${agent_version}}_nodejs${{ matrix.node-version }}x # Add Node runtime
echo "agent_version=${agent_version}" | tee -a "$GITHUB_OUTPUT"
- name: Call Publish Workflow for ${{ matrix.node-version }}
uses: ./.github/workflows/publish.yml
with:
INITCONTAINER_LANGUAGE: ${{ env.INITCONTAINER_LANGUAGE }}
K8S_OPERATOR_IMAGE_TAG: ${{ env.K8S_OPERATOR_IMAGE_TAG }}
NEW_RELIC_AGENT_VERSION: ${{ env.NEW_RELIC_AGENT_VERSION }}
AGENT_VERSION_TAG: ${{steps.version.output.agent_version}}
RUNTIME_VERSION: ${{ matrix.node-version }}