Skip to content

Systemd restore forward ports and fix restore validation (bsc#1244127 bsc#1246906) #1998

Systemd restore forward ports and fix restore validation (bsc#1244127 bsc#1246906)

Systemd restore forward ports and fix restore validation (bsc#1244127 bsc#1246906) #1998

Workflow file for this run

# SPDX-FileCopyrightText: 2023 SUSE LLC
#
# SPDX-License-Identifier: Apache-2.0
name: Build
on:
pull_request:
types:
- opened
- reopened
- synchronize
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-tags: true
fetch-depth: 0
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 #v5.3.0
with:
go-version: '1.22'
- name: Install dependencies
run: |
go get ./...
- name: Compute version
run: |
tag=$(git describe --tags --abbrev=0)
version=$(git describe --tags --abbrev=0 | cut -f 3 -d '-')
offset=$(git rev-list --count ${tag}..)
echo "VERSION=$tag-$offset" >> "$GITHUB_ENV"
- name: Build
run: |
mkdir -p ./bin
go build \
-tags netgo \
-ldflags "-X github.com/uyuni-project/uyuni-tools/shared/utils.Version=${{ env.VERSION }}" \
-o ./bin \
./...
- name: Build with all tags
run: |
mkdir -p ./bin
go build \
-tags netgo,nok8s,ptf \
-ldflags "-X github.com/uyuni-project/uyuni-tools/shared/utils.Version=${{ env.VERSION }}" \
-o ./bin \
./...
- name: Unit tests with all tags
run: go test -tags nok8s,ptf ./...
- name: Unit tests
run: go test ./...
- name: Upload binaries
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
with:
name: binaries
path: ./bin/*