Skip to content

Commit

Permalink
Github actions multi-build.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmorgan committed Mar 12, 2024
1 parent 6207494 commit fe2ee97
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 41 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/go-test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: tidy
run: go mod tidy

- name: Vet
run: go vet ./...

- name: Test
run: go test -v ./...

build:
needs: test
strategy:
matrix:
goos: [linux, darwin]
goarch: [arm64, amd64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: Build
working-directory: ./cmd/bfg
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: go build -a -trimpath -ldflags='-s -w' -o bfg_${{ matrix.goos }}_${{ matrix.goarch }}

- uses: actions/upload-artifact@v4
with:
name: bfg-build
path: cmd/bfg/bfg_${{ matrix.goos }}_${{ matrix.goarch }}
40 changes: 0 additions & 40 deletions .github/workflows/go-test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion sample/minify.bf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ read char until EOF (-1)
command case: kill flag
<[-]>]
>[.[-]] print and kill the copy
read a new char and subtract exclamation mark
read a new char and exit on EOF
<<,+]
++++++++++.

0 comments on commit fe2ee97

Please sign in to comment.