Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Commit Binaries

on:
push:
branches: [master]

concurrency:
group: building
cancel-in-progress: true

jobs:

build:
# Prevents the workflow from running on non-human triggers.
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up Go Environment
uses: actions/setup-go@v5
with:
go-version: '1.22.1'

- name: Build embed_code.go for Windows
run: GOOS=windows GOARCH=amd64 go build -trimpath -o bin/embed-code-windows.exe main.go

- name: Build embed_code.go for Ubuntu
run: GOOS=linux GOARCH=amd64 go build -trimpath -o bin/embed-code-linux main.go

- name: Build embed_code.go for MacOS
run: GOOS=darwin GOARCH=amd64 go build -trimpath -o bin/embed-code-macos main.go

- name: Commit Built Files
uses: EndBug/add-and-commit@v9
with:
add: './bin'
message: 'Update binaries.'
default_author: github_actions
push: true
27 changes: 27 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run Tests

on: pull_request

jobs:
build:
# Prevents the workflow from running on non-human triggers.
if: github.actor != 'github-actions[bot]'
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up Go Environment
uses: actions/setup-go@v5
with:
go-version: '1.22.1'

- name: Run Tests
# Tests must be run sequentially because they create temporary files that can cause issues.
# Therefore, the "-p 1" argument is required.
run: go test -v ./... -p 1
Loading