Skip to content
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/TriggerIntegrationTests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
token=$1
commit=$2
repository=$3
prNumber=$4
frombranch=$5
tobranch=$6
patUser=$6

getPayLoad() {
cat <<EOF
{
"event_type": "SetupKubectlActionPR",
"client_payload":
{
"action": "SetupKubectl",
"commit": "$commit",
"repository": "$repository",
"prNumber": "$prNumber",
"tobranch": "$tobranch",
"frombranch": "$frombranch"
}
}
EOF
}

response=$(curl -u $patUser:$token -X POST https://api.github.com/repos/Azure/azure-actions-integration-tests/dispatches --data "$(getPayLoad)")

if [ "$response" == "" ]; then
echo "Integration tests triggered successfully"
else
echo "Triggering integration tests failed with: '$response'"
exit 1
fi
19 changes: 19 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Trigger Integration tests"
on:
pull_request:
branches:
- main
- 'releases/*'
jobs:
trigger-integration-tests:
name: Trigger Integration tests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
path: IntegrationTests

- name: Trigger Test run
run: |
bash ./IntegrationTests/.github/workflows/TriggerIntegrationTests.sh ${{ secrets.L2_REPO_TOKEN }} ${{ github.event.pull_request.head.sha }} ${{ github.repository }} ${{ github.event.pull_request.number }} ${{ github.event.pull_request.head.ref }} ${{ github.event.pull_request.base.ref }} ${{ secrets.L2_REPO_USER }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "build-test"
name: "Run unit tests."
on: # rebuild any PRs and main branch changes
pull_request:
branches:
Expand All @@ -14,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: build and run tests

- name: Build and run L0 tests.
run: |
npm install
npm build
npm test
6 changes: 5 additions & 1 deletion lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.run = void 0;
exports.run = exports.downloadKubectl = exports.getStableKubectlVersion = exports.getkubectlDownloadURL = exports.getExecutableExtension = void 0;
const os = require("os");
const path = require("path");
const util = require("util");
Expand All @@ -25,6 +25,7 @@ function getExecutableExtension() {
}
return '';
}
exports.getExecutableExtension = getExecutableExtension;
function getkubectlDownloadURL(version) {
switch (os.type()) {
case 'Linux':
Expand All @@ -36,6 +37,7 @@ function getkubectlDownloadURL(version) {
return util.format('https://storage.googleapis.com/kubernetes-release/release/%s/bin/windows/amd64/kubectl.exe', version);
}
}
exports.getkubectlDownloadURL = getkubectlDownloadURL;
function getStableKubectlVersion() {
return __awaiter(this, void 0, void 0, function* () {
return toolCache.downloadTool(stableVersionUrl).then((downloadPath) => {
Expand All @@ -51,6 +53,7 @@ function getStableKubectlVersion() {
});
});
}
exports.getStableKubectlVersion = getStableKubectlVersion;
function downloadKubectl(version) {
return __awaiter(this, void 0, void 0, function* () {
let cachedToolpath = toolCache.find(kubectlToolName, version);
Expand All @@ -69,6 +72,7 @@ function downloadKubectl(version) {
return kubectlPath;
});
}
exports.downloadKubectl = downloadKubectl;
function run() {
return __awaiter(this, void 0, void 0, function* () {
let version = core.getInput('version', { 'required': true });
Expand Down