Skip to content

Commit

Permalink
Use WEBHOOK_REF_TEST
Browse files Browse the repository at this point in the history
Using other pipeline branch
  • Loading branch information
Stezido authored and Peter Baus committed Feb 10, 2021
1 parent a047617 commit fcf735d
Showing 1 changed file with 51 additions and 34 deletions.
85 changes: 51 additions & 34 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Audit/Test/Build CI

on:
on:
push:
branches:
- master
Expand All @@ -9,15 +9,23 @@ on:
types: [published]

jobs:

audit:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]
project: [frontend,api,blockchain,provisioning,e2e-test,excel-export,email-notification]

project:
[
frontend,
api,
blockchain,
provisioning,
e2e-test,
excel-export,
email-notification,
]

defaults:
run:
working-directory: ${{ matrix.project }}
Expand All @@ -31,15 +39,15 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Audit project ${{ matrix.project }}
run: npm audit --audit-level=high

test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]
project: [frontend, api]

defaults:
run:
working-directory: ${{ matrix.project }}
Expand All @@ -57,13 +65,22 @@ jobs:

docker-build:
runs-on: ubuntu-latest

needs: [test]

strategy:
matrix:
project: [frontend,api,blockchain,provisioning,e2e-test,excel-export,email-notification]

project:
[
frontend,
api,
blockchain,
provisioning,
e2e-test,
excel-export,
email-notification,
]

defaults:
run:
working-directory: ${{ matrix.project }}
Expand All @@ -90,7 +107,7 @@ jobs:
PRIVATE_REGISTRY_PASSWORD: ${{ secrets.PRIVATE_REGISTRY_PASSWORD}}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD}}

notification:
runs-on: ubuntu-latest

Expand All @@ -102,27 +119,27 @@ jobs:
GITHUB_PR_NUMBER: ${{ github.event.number}}

steps:
- name: Extract GITHUB_BRANCH
shell: bash
run: |
echo "GITHUB_BASE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Set branch env vars
run: |
if [ "$GITHUB_PR_NUMBER" != "" ]; then
echo "GITHUB_BASE_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV
echo "GITHUB_HEAD_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV
fi
- name: Trigger e2e-tests
run: curl -sX POST -F token=$WEBHOOK_TOKEN
-F ref=$WEBHOOK_REF
-F "variables[TRAVIS_PULL_REQUEST_BRANCH]=$GITHUB_HEAD_BRANCH"
-F "variables[TRAVIS_BRANCH]=$GITHUB_BASE_BRANCH"
-F "variables[TRAVIS_BUILD_ID]=t_$GITHUB_RUN_ID"
-F "variables[TRAVIS_EVENT_TYPE_FOR_BRANCH]=$GITHUB_EVENT_NAME-$GITHUB_BASE_BRANCH"
-F "variables[GITHUB_PULL_REQUEST]=$GITHUB_PR_NUMBER"
-F "variables[GITHUB_REPOSITORY]=$GITHUB_REPOSITORY"
$WEBHOOK_URL > /dev/null
env:
WEBHOOK_TOKEN: ${{ secrets.WEBHOOK_TOKEN }}
WEBHOOK_REF: ${{ secrets.WEBHOOK_REF }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
- name: Extract GITHUB_BRANCH
shell: bash
run: |
echo "GITHUB_BASE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Set branch env vars
run: |
if [ "$GITHUB_PR_NUMBER" != "" ]; then
echo "GITHUB_BASE_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV
echo "GITHUB_HEAD_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV
fi
- name: Trigger e2e-tests
run: curl -sX POST -F token=$WEBHOOK_TOKEN
-F ref=$WEBHOOK_REF
-F "variables[TRAVIS_PULL_REQUEST_BRANCH]=$GITHUB_HEAD_BRANCH"
-F "variables[TRAVIS_BRANCH]=$GITHUB_BASE_BRANCH"
-F "variables[TRAVIS_BUILD_ID]=t_$GITHUB_RUN_ID"
-F "variables[TRAVIS_EVENT_TYPE_FOR_BRANCH]=$GITHUB_EVENT_NAME-$GITHUB_BASE_BRANCH"
-F "variables[GITHUB_PULL_REQUEST]=$GITHUB_PR_NUMBER"
-F "variables[GITHUB_REPOSITORY]=$GITHUB_REPOSITORY"
$WEBHOOK_URL > /dev/null
env:
WEBHOOK_TOKEN: ${{ secrets.WEBHOOK_TOKEN }}
WEBHOOK_REF: ${{ secrets.WEBHOOK_REF_TEST }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}

0 comments on commit fcf735d

Please sign in to comment.