Skip to content

chore: checkout action from fork #523

chore: checkout action from fork

chore: checkout action from fork #523

Workflow file for this run

name: Test 🧪
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
workflow_dispatch:
concurrency:
group: test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test 🔍
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- 1.24.7
defaults:
run:
shell: bash
steps:
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v9.0.0
- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4.1.1
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
path: ${{ github.event.repository.name }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
- name: Checkout repo 🛎
uses: actions/checkout@v4.1.1
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.current_branch }}
path: ${{ github.event.repository.name }}
- name: Setup Go 🐹
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: go.sum
- name: Setup R required for tests
uses: r-lib/actions/setup-r@v2
- name: Run Tests 🧨
run: make test
- name: Check whether JUnit XML report exists 🚦
id: check-junit-xml
uses: andstor/file-existence-action@v3
with:
files: junit-report.xml
- name: Publish Unit Test Summary 📑
uses: EnricoMi/publish-unit-test-result-action@v2
id: test-results
if: steps.check-junit-xml.outputs.files_exists == 'true' && github.event_name == 'pull_request'
with:
check_name: Unit Tests Summary
junit_files: junit-report.xml
- name: Check whether coverage reports exists 💭
id: check-coverage-reports
uses: andstor/file-existence-action@v3
with:
files: >-
coverage.xml,
coverage.html
- name: Post coverage report 🗞
if: steps.check-coverage-reports.outputs.files_exists == 'true'
uses: insightsengineering/coverage-action@v2
with:
path: coverage.xml
threshold: 80
fail: false
publish: true
diff: true
coverage-reduction-failure: true
new-uncovered-statements-failure: true
continue-on-error: true
- name: Upload report 🔼
if: steps.check-coverage-reports.outputs.files_exists == 'true'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
coverage.html
continue-on-error: true
compilation:
name: Build 🏗
strategy:
matrix:
go-version:
- 1.24.7
runs-on: ubuntu-latest
steps:
- name: Checkout Repo 🛎
uses: actions/checkout@v5
- name: Setup Go 🐹
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: go.sum
- name: Check if compilation works 🧱
run: make build