Skip to content

Instantly share code, notes, and snippets.

@borodicht
Created December 9, 2024 14:24
Show Gist options
  • Save borodicht/1a21c1acdf0cf057801329d14db85ae4 to your computer and use it in GitHub Desktop.
Save borodicht/1a21c1acdf0cf057801329d14db85ae4 to your computer and use it in GitHub Desktop.
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Run test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
env:
USER: ${{secrets.USERNAME}}
PASSWORD: ${{secrets.PASSWORD}}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Cache Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: java
- name: Running BVT
run: mvn clean test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:'java'"
- name: Get Allure history
uses: actions/checkout@v2
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Allure Report action from marketplace
uses: simple-elf/allure-report-action@master
if: always()
with:
allure_results: target/allure-results
allure_history: allure-history
#keep_reports: 20
- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment