Skip to content

ci: added staticcheck and vet as linters #6

ci: added staticcheck and vet as linters

ci: added staticcheck and vet as linters #6

Workflow file for this run

name: unit tests
# About security when running the tests and NOT exposing
# the secrets to externals. Currently Github Actions does
# NOT expose the secrets if the branch is coming from a forked
# repository.
# See: https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/
# See: https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions
#
# An alternate would be to set, pull_request_target but this takes the CI code
# from master removing the ability to change the code in a PR easily.
#
# Aditionally, since 2021 pull requests from new contributors will not
# trigger workflows automatically but will wait for approval from somebody
# with write access.
# See: https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks
on:
pull_request:
branches: [main]
env:
SOURCE: /usr/src/connect-ng
jobs:
unit-tests:
runs-on: ubuntu-latest
container:
image: registry.suse.com/bci/golang:1.21-openssl
steps:
- uses: actions/checkout@v4
- name: move source to /usr/src/connect-ng
run: |
[ -d $SOURCE ] && rm -r $SOURCE
cp -r $GITHUB_WORKSPACE $SOURCE
- name: run unit tests
run: make test
- name: build the binary
run: |
# We need to make sure git trusts us here. mark the directory as safe playground
git config --global --add safe.directory /__w/connect-ng/connect-ng
make vendor build