Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Integration tests + tag if new version #656

Merged
merged 39 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f8f80a1
adding validate github action to pull requests raised to the master b…
gligorkot Feb 28, 2023
c9d39c2
adding required runs-on os for matrix strategy
gligorkot Feb 28, 2023
8065a75
removing the report coverage part as github action doesn't have acces…
gligorkot Feb 28, 2023
132d042
try fix node integration tests
gligorkot Mar 1, 2023
4fd461c
removing node10 and unused integration tests and adding node 14/16/18…
gligorkot Mar 1, 2023
c1a2316
moving to using local serverless-azure-functions package and adding p…
gligorkot Mar 1, 2023
82ed6fa
adding parameters for node 14/16/18 integrations tests + installing r…
gligorkot Mar 1, 2023
5c64122
stop retries so we can see all integration tests run
gligorkot Mar 1, 2023
d965aee
set correct node version in matrix
gligorkot Mar 1, 2023
3dd4fb1
remove deploy/invoke/remove integration tests as azure credentials do…
gligorkot Mar 1, 2023
fba1d0a
adding openssl-legacy-provider flag for node18 webpack compatibility
gligorkot Mar 1, 2023
b56a3b6
moving the openssl flag to serverless environment vars for node18 web…
gligorkot Mar 1, 2023
46217aa
update to latest webpack on node18 to fix openssl legacy flags issue
gligorkot Mar 1, 2023
c8bebdb
adding should contain for the sls package integration tests
gligorkot Mar 1, 2023
20c72ba
remove node18 webpack variants until we can get node18 webpack workin…
gligorkot Mar 1, 2023
b3f6c67
correcting package names
gligorkot Mar 1, 2023
0b36acf
adding some node options to running of integration tests
gligorkot Mar 1, 2023
ff453f0
bringing back node18 webpack versions in case the new node options ca…
gligorkot Mar 1, 2023
aa99fac
set node options based on matrix node version
gligorkot Mar 1, 2023
1b7a098
update if for node version comparison
gligorkot Mar 1, 2023
6975daf
adding python integration tests to the integration tests workflow
gligorkot Mar 1, 2023
4072eed
expand sls to serverless in integration tests
gligorkot Mar 1, 2023
2f09290
removing failing tests
gligorkot May 10, 2023
0db8858
testing integration tests
gligorkot May 13, 2023
d46d63c
Merge pull request #1 from serverless/master
gligorkot May 13, 2023
21c7b30
adding dotnet tests and removing last failing test + getting integrat…
gligorkot May 13, 2023
55e891c
bring back package test - make sure to run npm pack before running in…
gligorkot May 13, 2023
4b12964
remove package test again
gligorkot May 13, 2023
ddea2b0
removed npm link as this is not needed
gligorkot May 13, 2023
86bd86c
enabled python and dotnet integration tests again
gligorkot May 13, 2023
182e434
remove dotnet integration tests separate workflow (these are now comb…
gligorkot May 13, 2023
18d6727
adding a tag-new-version step that detects a new version tags the rep…
gligorkot May 13, 2023
743b830
adding run build for dotnet tests workflow
gligorkot May 13, 2023
2691c52
remove pack step from dotnet integrations tests
gligorkot May 13, 2023
130a87d
temporarily commented out .NET tests
gligorkot May 13, 2023
abdf750
testing new version tag
gligorkot May 13, 2023
ccdb484
revert package version change
gligorkot May 13, 2023
7bb653d
run integration tests on push to master
gligorkot May 13, 2023
e5eb5dd
adding a checkout step for tag if new version workflow
gligorkot May 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions .github/workflows/integration-tests-dotnet.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/integration-tests-node.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/integration-tests-python.yml

This file was deleted.

216 changes: 216 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
name: Integration tests

on:
push:
branches: [master]

jobs:
node-integration-tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12, 14, 16, 18]
os: [linux, windows]
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: npm-v${{ matrix.node-version }}-${{ matrix.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: |
npm-v${{ matrix.node-version }}-${{ matrix.os }}-${{ github.ref }}-
npm-v${{ matrix.node-version }}-${{ matrix.os }}-refs/heads/master-

- name: Install Node.js and npm
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm ci

- name: Compile
run: npm run compile

- name: Pack
run: npm pack

- name: Set node options
id: nodeOptions
run: |
if (( ${{ matrix.node-version }} > 16 )); then
echo "NODE_OPTIONS=--max_old_space_size=8192 --openssl-legacy-provider" >> $GITHUB_OUTPUT
else
echo "NODE_OPTIONS=--max_old_space_size=8192" >> $GITHUB_OUTPUT
fi

- name: Validate lint rules
run: npm run lint

- name: Run integration tests
run: npm run test:int -- -d 'node${{ matrix.node-version }}-${{ matrix.os }}(-webpack)?'
env:
NODE_OPTIONS: ${{ steps.nodeOptions.outputs.NODE_OPTIONS }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID}}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID}}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET}}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID}}

python-integration-tests:
runs-on: ubuntu-latest

strategy:
matrix:
runtime: [python36, python37, python38]
node-version: [12, 14, 16, 18]
os: [linux, windows]
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: npm-v${{ matrix.node-version }}-${{ matrix.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: |
npm-v${{ matrix.node-version }}-${{ matrix.os }}-${{ github.ref }}-
npm-v${{ matrix.node-version }}-${{ matrix.os }}-refs/heads/master-

- name: Install Node.js and npm
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm ci

- name: Compile
run: npm run compile

- name: Pack
run: npm pack

- name: Set node options
id: nodeOptions
run: |
if (( ${{ matrix.node-version }} > 16 )); then
echo "NODE_OPTIONS=--max_old_space_size=8192 --openssl-legacy-provider" >> $GITHUB_OUTPUT
else
echo "NODE_OPTIONS=--max_old_space_size=8192" >> $GITHUB_OUTPUT
fi

- name: Run integration tests
run: npm run test:int -- -d ${{ matrix.runtime }}
env:
NODE_OPTIONS: ${{ steps.nodeOptions.outputs.NODE_OPTIONS }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID}}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID}}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET}}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID}}

# TODO: re-enable .NET tests when they don't end up hanging - unreliable at the moment
# dotnet-integration-tests:
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# runtime: [dotnet31]
# node-version: [12, 14, 16, 18]
# os: [linux, windows]
# fail-fast: false
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
#
# - name: Retrieve dependencies from cache
# id: cacheNpm
# uses: actions/cache@v3
# with:
# path: |
# ~/.npm
# node_modules
# key: npm-v${{ matrix.node-version }}-${{ matrix.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
# restore-keys: |
# npm-v${{ matrix.node-version }}-${{ matrix.os }}-${{ github.ref }}-
# npm-v${{ matrix.node-version }}-${{ matrix.os }}-refs/heads/master-
#
# - name: Install Node.js and npm
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
#
# - name: Install dependencies
# if: steps.cacheNpm.outputs.cache-hit != 'true'
# run: |
# npm ci
#
# - name: Compile
# run: npm run compile
#
# - name: Set node options
# id: nodeOptions
# run: |
# if (( ${{ matrix.node-version }} > 16 )); then
# echo "NODE_OPTIONS=--max_old_space_size=8192 --openssl-legacy-provider" >> $GITHUB_OUTPUT
# else
# echo "NODE_OPTIONS=--max_old_space_size=8192" >> $GITHUB_OUTPUT
# fi
#
# - name: Setup dotnet 3.1
# if: matrix.runtime == 'dotnet31'
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.103'
#
# - name: Run integration tests
# run: npm run test:int -- -d '${{ matrix.runtime }}-${{ matrix.os }}'
# env:
# NODE_OPTIONS: ${{ steps.nodeOptions.outputs.NODE_OPTIONS }}
# AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID}}
# AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID}}
# AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET}}
# AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID}}

tag-if-new-version:
runs-on: ubuntu-latest
needs: [node-integration-tests, python-integration-tests]

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# Ensure to have complete history of commits pushed with given push operation
# It's loose and imperfect assumption that no more than 30 commits will be pushed at once
fetch-depth: 30
# Tag needs to be pushed with real user token, otherwise pushed tag won't trigger the actions workflow
# Hence we're passing 'serverless-ci' user authentication token
token: ${{ secrets.USER_GITHUB_TOKEN }}

- name: Tag if new version
run: |
NEW_VERSION=`git diff -U0 ${{ github.event.before }} package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || :
if [ -n "$NEW_VERSION" ];
then
git tag v$NEW_VERSION
git push --tags
fi
Loading