Skip to content

Qiskit demo day

Qiskit demo day #21

Workflow file for this run

name: Golang qat-computer tests
on:
pull_request:
paths:
- 'qat_computer/**'
- '.github/workflows/**'
workflow_dispatch:
env:
GO_DIR: qat_computer
GO_VERSION: 1.19
jobs:
style:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6.0.1
with:
version: latest
working-directory: ${{env.GO_DIR}}
- name: fmt
run: |
cd "${GO_DIR}"
check=$(go fmt)
if [["${check}" -ne ""]]; then
exit 1
fi
unittests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
- name: run tests
run: |
cd "${GO_DIR}"
go test ./... -covermode=count -coverprofile ./coverage.out
- name: coverage
run: |
cd "${GO_DIR}"
total_cov=$(go tool cover -func ./coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+')
if [[ "$total_cov" < 80.0 ]]; then
echo "not enought tests"
echo "::warning title=not enought tests::${total_cov}%"
#exit 1
fi
configlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: ${{env.GO_DIR}}/resources/conf
config_data: "{extends: default, rules: {line-length: disable}}"