Skip to content

Add unit tests and adapt pipeline #4

Add unit tests and adapt pipeline

Add unit tests and adapt pipeline #4

Workflow file for this run

name: Go Multi-Platform Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18
- name: Install dependencies
run: go mod tidy
- name: Run tests
run: go test -v ./...
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
output_name: goimg2pdf_linux
- os: windows-latest
output_name: goimg2pdf.exe
- os: macos-latest
output_name: goimg2pdf_macos
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build
run: go build -v -o ${{ matrix.output_name }} ./...
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.output_name }}
path: ${{ matrix.output_name }}