Skip to content

Clarify search results (#77) #169

Clarify search results (#77)

Clarify search results (#77) #169

Workflow file for this run

name: Build+Test Linux
on:
push:
paths-ignore:
- "*.md"
workflow_dispatch:
env:
TERMSHOT_VERSION: "0.2.10"
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-latest
go:
- "1.22"
- "stable"
architecture:
- amd64
- arm64
- arm
- riscv64
runs-on: ${{ matrix.os }}
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libmpv-dev libglx-dev libgl-dev \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-arm-linux-gnueabi g++-arm-linux-gnueabi \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- uses: actions/checkout@v4
- name: Install Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Set Environment Variables for Cross-Compilation
run: |
export CGO_ENABLED=1
if [ "${{ matrix.architecture }}" == "amd64" ]; then
export GOARCH=amd64
export GOOS=linux
elif [ "${{ matrix.architecture }}" == "arm64" ]; then
export GOARCH=arm64
export GOOS=linux
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
elif [ "${{ matrix.architecture }}" == "arm" ]; then
export GOARCH=arm
export GOOS=linux
export CC=arm-linux-gnueabi-gcc
export CXX=arm-linux-gnueabi-g++
elif [ "${{ matrix.architecture }}" == "riscv64" ]; then
export GOARCH=riscv64
export GOOS=linux
export CC=riscv64-linux-gnu-gcc
export CXX=riscv64-linux-gnu-g++
fi
- name: Get Go deps
run: go get .
- name: Run tests
run: go test -v ./...
- name: Compile
run: go build -o stmps-linux-${{ matrix.architecture }}
- name: Upload binary as artifact
if: matrix.os == 'ubuntu-latest' && matrix.go == 'stable' && matrix.architecture == 'amd64'
uses: actions/upload-artifact@v4
with:
path: stmps-linux-${{ matrix.architecture }}
name: stmps-linux-${{ matrix.architecture }}
screenshot:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download and unpack termshot
run: |
wget https://github.com/homeport/termshot/releases/download/v${{ env.TERMSHOT_VERSION }}/termshot_${{ env.TERMSHOT_VERSION }}_linux_amd64.tar.gz
tar -xzf termshot_${{ env.TERMSHOT_VERSION }}_linux_amd64.tar.gz
chmod +x termshot
- name: Download binary from build job
uses: actions/download-artifact@v4
with:
name: stmps-linux-amd64
path: .
- name: Make binary executable and rename it
run: |
chmod +x stmps-linux-amd64
mv stmps-linux-amd64 ./stmps
- name: Run and screenshot STMPS
run: |
./termshot ./stmps --output stmps_screenshot.png
continue-on-error: true
- name: Upload screenshot
uses: actions/upload-artifact@v4
with:
name: stmps_screenshot
path: stmps_screenshot.png