Upgrade vendors and switch to tablewriter 1.x (#43) #109
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: tests | |
on: [push] | |
jobs: | |
check: | |
name: Go ${{ matrix.go }} checks | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
go: [ 'stable', 'oldstable' ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install build tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y asciidoc docbook-utils docbook-xml libxml2-utils xsltproc | |
- name: Build sshproxy | |
run: make | |
- name: Run checks | |
run: make get-deps check | |
- name: Upload coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-${{ matrix.go }} | |
path: test/coverage.out | |
coverage: | |
name: Publish Coverage | |
needs: check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download coverage artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage-stable | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
- name: Convert go coverage to corbetura format | |
run: | | |
go install github.com/boumenot/gocover-cobertura@latest | |
gocover-cobertura -by-files < coverage.out > coverage.xml | |
- name: Get PR number | |
uses: jwalton/gh-find-current-pr@v1 | |
id: finder | |
- name: Add Coverage PR Comment | |
uses: 5monkeys/cobertura-action@master | |
with: | |
path: coverage.xml | |
skip_covered: false | |
minimum_coverage: 0 | |
fail_below_threshold: true | |
pull_request_number: ${{ steps.finder.outputs.pr }} | |
test: | |
name: Docker tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run tests | |
run: make test | |
binary-archive: | |
name: Publish binary archive | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
- name: Build sshproxy | |
run: make binary-archive | |
- name: Attach binary archive to release | |
uses: xresloader/upload-to-github-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
file: "sshproxy_*.tar.gz" | |
tags: true | |
draft: true | |
rpm: | |
name: Publish RPMs | |
runs-on: ubuntu-latest | |
container: | |
image: fedora:latest | |
options: --privileged | |
steps: | |
- name: Prepare mock and rpm-build | |
run: | | |
dnf -y install asciidoc git golang make rpm-build | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create source archive | |
run: | | |
git config --global --add safe.directory /__w/sshproxy/sshproxy | |
make source-archive | |
- name: Build RPMs | |
run: | | |
mkdir -p ~/rpmbuild/SOURCES | |
mv sshproxy-*.tar.gz ~/rpmbuild/SOURCES/ | |
rpmbuild -ba misc/sshproxy.spec | |
- name: Attach RPM and SRPM to release | |
uses: xresloader/upload-to-github-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
file: "/github/home/rpmbuild/RPMS/x86_64/*.rpm;/github/home/rpmbuild/SRPMS/*.rpm" | |
tags: true | |
draft: true |