Added e2e tests for Node #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2010 New Relic, Inc. | ||
# | ||
# 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: | ||
call-test: | ||
if: github.event_name == 'release' && endsWith(github.ref, '_nodejs') # Skip everything if this isn't Node | ||
uses: ./.github/workflows/test.yml | ||
Check failure on line 44 in .github/workflows/nodejs.yml GitHub Actions / NodeJs Init Container CIInvalid workflow file
|
||
with: | ||
RUNTIME_VERSION: ${{ matrix.node-version }} | ||
call-publish: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- 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 }} |