-
Notifications
You must be signed in to change notification settings - Fork 17
45 lines (38 loc) · 1.48 KB
/
unit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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