Skip to content

Optimize makefile and support automatic compilation #2

Optimize makefile and support automatic compilation

Optimize makefile and support automatic compilation #2

Workflow file for this run

name: Build & Test
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build-matrix:
name: Build on ${{ matrix.os }} (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Build
run: |
make pre_build build_yaml
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w" -o target/chaosblade-${{ matrix.goos }}_${{ matrix.goarch }}/bin/chaos_os main.go
test:
name: Test on Linux/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Run tests
run: make test