1.3.0: ci: add test for the code #1
Some checks failed
Test Pipeline / ci-test (pull_request) Failing after 20s
Test Pipeline / lint (pull_request) Failing after 1m36s

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-09-25 23:20:51 +02:00
commit 3f0a638266
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -1,3 +1,5 @@
name: Test Pipeline
on: on:
pull_request: pull_request:
types: [opened, synchronize] types: [opened, synchronize]
@ -17,4 +19,43 @@ jobs:
- name: golangci-lint - name: golangci-lint
uses: https://github.com/golangci/golangci-lint-action@v8 uses: https://github.com/golangci/golangci-lint-action@v8
with: with:
version: v2.1 version: v2.1
ci-test:
runs-on: raw
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install docker-cli
run: |
apt-get update
apt-get install -y ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y docker-ce-cli
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
run: |
docker build --pull -t users-release --target release .
- name: Run Test
run: |
bash -ex ./scripts/prepar_test.sh
. ./config/test.src
go test -v ./cmd/
go install gotest.tools/gotestsum@latest
gotestsum --junitfile report.xml --format testname