forked from kbase/narrative
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (64 loc) · 2.28 KB
/
integration_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI integration testing
on:
workflow_call:
secrets:
GHCR_USERNAME:
required: true
GHCR_TOKEN:
required: true
NARRATIVE_TEST_TOKEN:
required: true
jobs:
run_integration_tests:
runs-on: ubuntu-latest
steps:
-
name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
-
name: Repo checkout
uses: actions/checkout@v2
-
name: Set up environment
run: |
if [ ${{ github.base_ref }} == 'main' ]; then
branch=''
else
branch="-""${{ github.base_ref }}"
fi
narrative_version=`grep '\"version\":' src/config.json.templ | awk '{print $2}' | sed 's/"//g'`
narrative_git_hash=`grep '\"git_commit_hash\":' src/config.json.templ | awk '{print $2}' | sed 's/"//g' | sed 's/,//'`
echo "APP_IMAGE_TAG=ghcr.io/${{ github.repository }}${branch}:pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "APP_VERSION_IMAGE_TAG=ghcr.io/${{ github.repository }}${branch}_version:pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "BRANCH=${branch}" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
echo "NARRATIVE_GIT_HASH=${narrative_git_hash}" >> $GITHUB_ENV
echo "NARRATIVE_VERSION=${narrative_version}" >> $GITHUB_ENV
echo "PR=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "VCS_REF=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c -7)" >> $GITHUB_ENV
-
name: Pull docker image
shell: bash -l {0}
run: docker pull ${{ env.APP_IMAGE_TAG }}
-
name: Use Node JS 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
-
name: Install JS dependencies
run: |
npm ci
npm run install-npm
cp src/config.json kbase-extension/static/kbase/config/
-
name: Run Narrative Frontend Integration Tests
shell: bash -l {0}
env:
BASE_URL: http://localhost:32323
KBASE_TEST_TOKEN: ${{ secrets.NARRATIVE_TEST_TOKEN }}
run: bash scripts/run_tests.sh -i -c ${{ env.APP_IMAGE_TAG }}