Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use beta s in github action test #6

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 18 additions & 16 deletions .github/workflows/ci_node16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
env:
RANDSTR: github_node16
REGION: cn-hongkong
DEVS_TEST_AK_ID: ${{secrets.DEVS_TEST_AK_ID}}
DEVS_TEST_AK_SECRET: ${{secrets.DEVS_TEST_AK_SECRET}}
DEVS_TEST_UID: ${{secrets.DEVS_TEST_UID}}

jobs:
macos-ci:
Expand All @@ -21,27 +24,25 @@ jobs:
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: |
brew update
brew install curl wget
- name: install s
run: |
npm i @serverless-devs/s@v3 -g
npm i @serverless-devs/s -g
- name: config s
run: |
s config add --AccountID ${{secrets.ACCOUNTID}} --AccountID ${{secrets.ACCOUNTID}} --AccessKeyID ${{secrets.ACCESSKEYID}} --AccessKeySecret ${{secrets.ACCESSKEYSECRET}} -a quanxi -f
- name: NPM install
run: |
npm install
- name: run base ci ut and it
run: |
npm run test
- name: NPM run build
run: |
npm run build
- name: run base ci
- name: run base ci e2e
run: |
cd __tests__/e2e && ./ci-mac-linux.sh && cd -


windows-ci:
runs-on: windows-latest
steps:
Expand All @@ -52,21 +53,23 @@ jobs:
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: |
choco install -y wget
choco install -y curl
- name: install s
run: |
npm i @serverless-devs/s@v3 -g
npm i @serverless-devs/s -g
- name: config s
run: |
s config add --AccountID ${{secrets.ACCOUNTID}} --AccessKeyID ${{secrets.ACCESSKEYID}} --AccessKeySecret ${{secrets.ACCESSKEYSECRET}} -a quanxi -f
- name: NPM install
run: |
npm install
- name: run base ci ut and it
run: |
npm run test
- name: NPM run build
run: |
npm run build
- name: run base ci
- name: run base ci e2e
shell: pwsh
run: |
cd __tests__/e2e
Expand All @@ -80,22 +83,21 @@ jobs:
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget curl
- name: install s
run: |
npm i @serverless-devs/s@v3 -g
npm i @serverless-devs/s -g
- name: config s
run: |
s config add --AccountID ${{secrets.ACCOUNTID}} --AccessKeyID ${{secrets.ACCESSKEYID}} --AccessKeySecret ${{secrets.ACCESSKEYSECRET}} -a quanxi -f
- name: NPM install
run: |
npm install
- name: run base ci ut and it
run: |
npm run test
- name: NPM run build
run: |
npm run build
- name: run base ci
- name: run base ci e2e
run: |
cd __tests__/e2e && ./ci-mac-linux.sh && cd -
2 changes: 1 addition & 1 deletion .github/workflows/ci_with_docker_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
sudo apt-get install -y wget curl
- name: install s
run: |
sudo npm i @serverless-devs/s@v3 -g
sudo npm i @serverless-devs/s -g
- name: config s
run: |
sudo s config add --AccountID ${{secrets.ACCOUNTID}} --AccessKeyID ${{secrets.ACCESSKEYID}} --AccessKeySecret ${{secrets.ACCESSKEYSECRET}} -a quanxi -f
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ci_with_docker_macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 8
- name: Install dependencies
run: |
brew install wget curl
- name: install s
run: |
npm i @serverless-devs/s@v3 -g
npm i @serverless-devs/s -g
- name: config s
run: |
s config add --AccountID ${{secrets.ACCOUNTID}} --AccessKeyID ${{secrets.ACCESSKEYID}} --AccessKeySecret ${{secrets.ACCESSKEYSECRET}} -a quanxi -f
Expand Down
17 changes: 8 additions & 9 deletions __tests__/it/integration_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IInputs } from '../../src/interface';
import _Logger from '@serverless-devs/logger';
import path from 'path';
import _ from 'lodash';
import { removeNullValues } from '../../src/utils';

const loggerInstance = new _Logger({
traceId: 'traceId_12345789',
Expand All @@ -18,7 +19,7 @@ const inputs: IInputs = {
// 项目名称
name: 'hello-world-app',
props: {
region: 'cn-huhehaote',
region: process.env.REGION==='cn-hongkong'?'cn-hongkong':'cn-huhehaote',
functionName: 'start-py',
description: 'hello world by serverless devs',
runtime: 'python3.9',
Expand Down Expand Up @@ -54,7 +55,7 @@ test('deploy event function', async () => {
const myFcInstance = new Fc({ logger: logger });
const output = await myFcInstance.deploy(inputs);
expect(output).toEqual({
region: 'cn-huhehaote',
region: process.env.REGION || 'cn-huhehaote',
description: 'hello world by serverless devs',
functionName: 'start-py',
handler: 'index.handler',
Expand Down Expand Up @@ -83,8 +84,10 @@ inputs_http.props.triggers = [
test('deploy http function', async () => {
const myFcInstance = new Fc({ logger: logger });
const output = await myFcInstance.deploy(inputs_http);
removeNullValues(output);
delete output['url']
expect(output).toEqual({
region: 'cn-huhehaote',
region: process.env.REGION || 'cn-huhehaote',
description: 'hello world by serverless devs',
functionName: 'start-py',
handler: 'index.handler',
Expand All @@ -98,17 +101,13 @@ test('deploy http function', async () => {
description: 'xxxx',
qualifier: 'LATEST',
triggerConfig: {
methods: ['GET', 'POST'],
authType: 'anonymous',
disableURLInternet: false,
methods: ['GET', 'POST'],
},
triggerName: 'httpTrigger',
triggerType: 'http',
},
],
url: {
system_url: 'https://start-py-reyloeixmp.cn-huhehaote.fcapp.run',
system_intranet_url: 'https://start-py-reyloeixmp.cn-huhehaote-vpc.fcapp.run',
},
]
});
});
4 changes: 3 additions & 1 deletion __tests__/ut/utils_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ describe('isAutoVpcConfig', () => {
});

test('getTimeZone', () => {
expect(getTimeZone()).toEqual('UTC+8');
const t = getTimeZone();
console.log(t);
expect(t === 'UTC+0' || t === 'UTC+8').toBe(true);
});

describe('removeNullValues', () => {
Expand Down
Loading