Skip to content

Commit

Permalink
Merge pull request #1 from vxcontrol/add_386_support
Browse files Browse the repository at this point in the history
Added i386 arch support in rmx dependency
  • Loading branch information
asdek authored May 5, 2023
2 parents 8d27189 + cb51ce6 commit 05ebc4c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 5 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Test

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
CGO_ENABLED: 1

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- i386
- amd64
go:
- '1.19'
- '1.20'

steps:
- uses: actions/checkout@v3

- name: Setup Go
uses: actions/[email protected]
with:
go-version: ${{ matrix.go }}

- name: Install gcc
if: matrix.arch == 'amd64'
run: |
sudo apt update
sudo apt install gcc -y
- name: Install gcc-multilib
if: matrix.arch == 'i386'
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install gcc-multilib -y
# amd64
- name: 'Build with ${{ matrix.go }} for amd64'
if: ${{ matrix.arch == 'amd64' }}
run: go build -race -v ./...

- name: 'Test with ${{ matrix.go }} for amd64'
if: ${{ matrix.arch == 'amd64' }}
run: go test -race -v ./...

- name: 'Bench with ${{ matrix.go }} for amd64'
if: ${{ matrix.arch == 'amd64' }}
run: go test -bench=. -benchmem -race -v ./...

# 386
- name: 'Build with ${{ matrix.go }} for i386'
if: ${{ matrix.arch == 'i386' }}
env:
CGOENABLED: true
GOARCH: 386
CGO_LDFLAGS: -static
run: |
go test -c -v ./...
- name: 'Test and Bench with ${{ matrix.go }} on i386'
if: ${{ matrix.arch == 'i386' }}
uses: vxcontrol/[email protected]
with:
arch: i386
distro: bullseye
dockerRunArgs: --mount type=bind,source="$(pwd)",target=/checkout,readonly
run: |
find /checkout -name '*.test' -type f -executable -print0 | \
xargs -t -0 -I '{}' sh -c '{} -test.v && {} -test.bench=. -test.benchmem -test.v'
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/vxcontrol/luar

go 1.13

require github.com/vxcontrol/golua v1.2.1
require github.com/vxcontrol/golua v1.3.0
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/vxcontrol/golua v1.2.1 h1:vCfL3Z2WTGkgwPPsg3/SAVycOeU9y7iZ3dKtkSLfpYs=
github.com/vxcontrol/golua v1.2.1/go.mod h1:26j63zy6Cb44iDabdQKZp5l6kR1PY+v26nO+T7tZFtE=
github.com/vxcontrol/rmx v1.0.0 h1:tUOStV2fXBm4xrtSjIye4bLHI0ud/IhkvMbaeMyp8ts=
github.com/vxcontrol/rmx v1.0.0/go.mod h1:1styoLiLxmoRJtwR6cjrcrt5LheQcFP+dXcSgr3W8ZQ=
github.com/vxcontrol/golua v1.3.0 h1:kjNNG+oL/bKSpDBMBQwzPgSDDrxoG9xVrNlVKxmWCoI=
github.com/vxcontrol/golua v1.3.0/go.mod h1:IsfilvnfNXs9C5maGYflqqUdX4igeeskG3lhYofqg3Q=
github.com/vxcontrol/rmx v1.1.0 h1:iKkzPj0pkqe/DBS2XkOZn+i8GxbtJiFKEPCqOr8/2wE=
github.com/vxcontrol/rmx v1.1.0/go.mod h1:1styoLiLxmoRJtwR6cjrcrt5LheQcFP+dXcSgr3W8ZQ=

0 comments on commit 05ebc4c

Please sign in to comment.