Skip to content

Fix crash on empty join filter #122

Fix crash on empty join filter

Fix crash on empty join filter #122

Workflow file for this run

# Copyright 2022 Stichting ThingsIX Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: Forwarder
on:
pull_request:
branches:
- main
push:
tags:
- v*
jobs:
test-build-amd64:
if: startsWith(github.ref, 'refs/tags/') == false
name: Test Build for AMD64
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.5
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: cd ./cmd/forwarder && CGO_ENABLED=0 go build -ldflags "-w -s -X github.com/ThingsIXFoundation/packet-handling/utils.commit=${{github.sha}}" .
release-build:
if: startsWith(github.ref, 'refs/tags/')
name: Build for all archs
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: ['386', amd64, arm64, arm]
include:
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
- goos: linux
goarch: mipsle
gomips: softfloat
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.5
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build
run: |
cd ./cmd/forwarder
CGO_ENABLED=0 GOOS=${{matrix.goos}} GOARCH=${{matrix.goarch}} GOMIPS="${{matrix.gomips}}" go build -ldflags "-w -s -X github.com/ThingsIXFoundation/packet-handling/utils.version=${{github.ref_name}} -X github.com/ThingsIXFoundation/packet-handling/utils.commit=${{github.sha}}" .
tar -zcvf thingsix-forwarder-${{matrix.goos}}-${{matrix.goarch}}${{matrix.gomips}}-${{github.ref_name}}.tar.gz forwarder*
- uses: actions/upload-artifact@v3
with:
name: thingsix-forwarder-${{matrix.goos}}-${{matrix.goarch}}${{matrix.gomips}}-${{github.ref_name}}
path: ./cmd/forwarder/*.tar.gz
if-no-files-found: error
release-package-all:
if: startsWith(github.ref, 'refs/tags/')
name: Package all binaries together
runs-on: ubuntu-latest
needs: [release-build]
steps:
- name: Download all binaries
uses: actions/download-artifact@v3
- run: mv **/*.tar.gz .
- name: Upload binaries together
uses: actions/upload-artifact@v3
with:
name: thingsix-forwarder-${{github.ref_name}}
path: '*.tar.gz'