Skip to content

Update EnricoMi/publish-unit-test-result-action action to v2 #622

Update EnricoMi/publish-unit-test-result-action action to v2

Update EnricoMi/publish-unit-test-result-action action to v2 #622

Workflow file for this run

---
name: "GitHub CI"
permissions:
contents: read
pull-requests: write
actions: read
issues: read
discussions: write
repository-projects: write
checks: write
on:
pull_request:
branches: [master]
jobs:
clj-kondo:
runs-on: ubuntu-latest
timeout-minutes: 5
container: cljkondo/clj-kondo:2023.07.13-alpine
steps:
- uses: actions/checkout@v3.5.3
- name: Run clj-kondo
run: >-
clj-kondo
--config .clj-kondo/config.edn
--config-dir .clj-kondo
--parallel
--lint src test
cljstyle:
runs-on: ubuntu-latest
timeout-minutes: 5
container: abogoyavlensky/cljstyle:0.15.0
steps:
- uses: actions/checkout@v3.5.3
- name: Check with cljstyle
run: cljstyle check --report
megalinter:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3.5.3
- name: Mega-Linter
id: ml
uses: nvuillam/mega-linter/flavors/java@v7.3.0
env:
# All available variables are described in documentation
# https://nvuillam.github.io/mega-linter/configuration/
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} # Validates all source when push on master, else just the git diff with master. Override with true if you always want to lint all sources
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload Mega-Linter artifacts
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: Mega-Linter reports
path: |
report
mega-linter.log
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3.12.0
with:
distribution: zulu
java-version: 17
- name: Restore local Maven repository from cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
restore-keys: |
${{ runner.os }}-maven-
- name: Generate proto files
run: lein protodeps generate
- name: Build uberjar
run: lein uberjar
test:
needs:
- build
- clj-kondo
- cljstyle
- megalinter
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Set up JDK 17
uses: actions/setup-java@v3.12.0
with:
distribution: zulu
java-version: 17
- name: Restore local Maven repository from cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
restore-keys: |
${{ runner.os }}-maven-
- name: Generate proto files
run: lein protodeps generate
- name: Unit tests
env:
IP_STACK_ACCESS_KEY: ${{ secrets.IP_STACK_ACCESS_KEY }}
run: lein cloverage --html --lcov --junit
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2.7
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "target/coverage/junit.xml"
- name: Coveralls
uses: coverallsapp/github-action@v2.2.1
with:
path-to-lcov: "target/coverage/lcov.info"
github-token: ${{ secrets.GITHUB_TOKEN }}