Skip to content

feat(installer): Download and install default repository files #23

feat(installer): Download and install default repository files

feat(installer): Download and install default repository files #23

Workflow file for this run

name: Test
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:
jobs:
test:
name: Run Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['1.21', '1.22']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Run unit tests
shell: bash
run: go test -v -race -coverprofile=coverage.out ./...
- name: Build binary for integration tests
if: matrix.os != 'windows-latest'
shell: bash
run: go build -o shelldock .
- name: Run integration tests
if: matrix.os != 'windows-latest'
shell: bash
run: |
chmod +x test/test-suite.sh
./test/test-suite.sh
- name: Upload coverage
uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21'
with:
file: ./coverage.out
flags: unittests
name: codecov-umbrella
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --timeout=5m
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
exclude:
- os: ubuntu-latest
goos: darwin
- os: ubuntu-latest
goos: windows
- os: macos-latest
goos: linux
- os: macos-latest
goos: windows
- os: windows-latest
goos: linux
- os: windows-latest
goos: darwin
- os: ubuntu-latest
goarch: arm64
goos: windows
- os: macos-latest
goarch: arm64
goos: windows
- os: windows-latest
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build (Linux/macOS)
if: matrix.os != 'windows-latest'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build -o shelldock-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} .
- name: Build (Windows)
if: matrix.os == 'windows-latest'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
shell: pwsh
run: |
go build -o shelldock-${{ matrix.goos }}-${{ matrix.goarch }}.exe .
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.goos }}-${{ matrix.goarch }}
path: shelldock-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }}