gh-integration #362
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: gh-integration | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
TEST_ENDPOINT: | |
description: "Endpoint for tests" | |
required: true | |
default: https://dev.github.com | |
TEST_BROWSER: | |
description: "Browser for tests" | |
required: true | |
default: chrome | |
ALLURE_JOB_RUN_ID: | |
description: "ALLURE_JOB_RUN_ID service parameter. Leave blank." | |
required: false | |
ALLURE_USERNAME: | |
description: "ALLURE_USERNAME service parameter. Leave blank" | |
required: false | |
env: | |
ALLURE_ENDPOINT: ${{ secrets.ALLURE_ENDPOINT }} | |
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | |
ALLURE_PROJECT_ID: ${{ secrets.ALLURE_PROJECT_ID }} | |
ALLURE_TESTPLAN_PATH: "./testplan.json" | |
ALLURE_RESULTS: "build/allure-results" | |
ALLURE_JOB_RUN_ID: ${{ github.event.inputs.ALLURE_JOB_RUN_ID }} | |
ALLURE_LAUNCH_TAGS: "release, critical" | |
jobs: | |
all-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: install and configure allurectl | |
uses: allure-framework/setup-allurectl@v1 | |
with: | |
allure-endpoint: ${{ secrets.ALLURE_ENDPOINT }} | |
allure-token: ${{ secrets.ALLURE_TOKEN }} | |
allure-project-id: ${{ secrets.ALLURE_PROJECT_ID }} | |
- name: Prepare TestPlan | |
run: allurectl job-run plan --output-file ${ALLURE_TESTPLAN_PATH} | |
- name: Build with Gradle | |
run: | | |
allurectl watch -- ./gradlew clean test | |
export $( ./allurectl job-run env) | |
printenv | grep TEST_ | |
printenv | grep ALLURE_ | |
echo ${ALLURE_JOB_RUN_ID} | |
env: | |
TEST_ENDPOINT: ${{ github.event.inputs.TEST_ENDPOINT }} | |
TEST_BROWSER: ${{ github.event.inputs.TEST_BROWSER }} | |
- name: Extract and save ALLURE_JOB_RUN_ID | |
run: | | |
ALLURE_JOB_RUN_ID=$(printenv | grep 'ALLURE_JOB_RUN_ID' | cut -d '=' -f2) | |
echo "ALLURE_JOB_RUN_ID=${ALLURE_JOB_RUN_ID}" >> $GITHUB_ENV | |
echo "ALLURE_JOB_RUN_ID: ${ALLURE_JOB_RUN_ID}" | |
- name: Get ALLURE_ environments | |
run: | | |
export $(allurectl job-run env) | |
printenv | grep ALLURE_ | |
echo ${ALLURE_JOB_RUN_ID} | |
- name: Get GITHUB_ environments | |
run: | | |
printenv | grep GITHUB_ | |
- name: List results | |
run: ls -la ${ALLURE_RESULTS} | |
- name: Upload Allure Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: allure-results | |
path: ${{ env.ALLURE_RESULTS }} |