Skip to content

Test Docker

Test Docker #16

Workflow file for this run

name: Github Actions use case
on:
workflow_dispatch:
inputs:
job:
description: 'Select the job to run'
type: choice
options:
- test-docker
- test-action-gh-pages
- test-action-firebase
default: test-action
retries:
description: 'Number of test runs to show as retries in report'
default: '10'
show-history:
description: 'Show keep history in report'
type: boolean
default: true
report-name:
description: 'Title of the report'
required: false
default: 'Allure Report'
jobs:
test-docker:
if: ${{ github.event.inputs.job == 'test-docker' }}
runs-on: ubuntu-latest
env:
GCP_SECRETS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
steps:
- uses: actions/[email protected]
- name: Run Tests
run: |
echo 'No test to run, using existing assets/allure-results from this repository'
- name: Write GCP Credentials
run: |
echo "$GCP_SECRETS" > ${{ github.workspace }}/gcp-key.json
- name: Authenticate Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Deploy Allure Report to Firebase
run: |
docker run --rm \
-e STORAGE_BUCKET=${{vars.STORAGE_BUCKET}} \
-e RETRIES=${{ github.event.inputs.retries }} \
-e SHOW_HISTORY=${{ github.event.inputs.show-history }} \
-e SLACK_TOKEN=${{secrets.SLACK_TOKEN}} \
-e SLACK_CHANNEL=${{secrets.SLACK_CHANNEL_ID}} \
-v ${{ github.workspace }}/assets/allure-results:/allure-results \
-v ${{ github.workspace }}/gcp-key.json:/credentials/key.json \
sokari/allure-deployer:latest
test-action-firebase:
if: ${{ github.event.inputs.job == 'test-action-firebase' }}
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Allure Deployer Action
uses: cybersokari/[email protected]
env:
SLACK_TOKEN: ${{secrets.SLACK_TOKEN}}
GOOGLE_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
with:
allure_results_path: 'assets/allure-results'
storage_bucket: ${{vars.STORAGE_BUCKET}}
slack_channel: ${{secrets.SLACK_CHANNEL_ID}}
show_history: ${{github.event.inputs.show-history}}
retries: ${{github.event.inputs.retries}}
prefix: 'test-action-firebase'
update_pr: 'summary'
test-action-gh-pages:
if: ${{ github.event.inputs.job == 'test-action-gh-pages' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/[email protected]
- name: Generate Allure Report with History and Retries
uses: cybersokari/[email protected]
with:
google_credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
allure_results_path: 'assets/allure-results'
storage_bucket: ${{vars.STORAGE_BUCKET}}
target: 'github'
github_pages_branch: 'gh-pages'
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
show_history: ${{github.event.inputs.show-history}}
retries: ${{github.event.inputs.retries}}
prefix: 'test-action-gh-pages'