-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added arch i386 support * fix: using another actions for i386 according to uraimo/run-on-arch-action#58 * fix: using refs for actions link * fix: refs to full commit version hash * fix: changed base action image to own fork * fix: arch typo 386 => i386
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
arch: | ||
- i386 | ||
- arm64 | ||
- amd64 | ||
go: | ||
|
@@ -44,6 +45,25 @@ jobs: | |
if: ${{ matrix.arch == 'amd64' }} | ||
run: go test -bench=. -benchmem -race -v ./... | ||
|
||
# 386 | ||
- name: 'Build with ${{ matrix.go }} for i386' | ||
if: ${{ matrix.arch == 'i386' }} | ||
env: | ||
GOARCH: 386 | ||
run: | | ||
go test -c *.go && cd goid && go test -c ./... | ||
- 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' | ||
# arm64 | ||
- name: 'Build with ${{ matrix.go }} for arm64' | ||
if: ${{ matrix.arch == 'arm64' }} | ||
|
@@ -54,7 +74,7 @@ jobs: | |
- name: 'Test and Bench with ${{ matrix.go }} on arm64' | ||
if: ${{ matrix.arch == 'arm64' }} | ||
uses: uraimo/run-on-arch-action@v2 | ||
uses: vxcontrol/run-on-arch-action@0.9.0 | ||
with: | ||
arch: aarch64 | ||
distro: bullseye | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package goid | ||
|
||
func getg() *g | ||
|
||
func Get() int64 { | ||
return getg().goid | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "go_asm.h" | ||
#include "textflag.h" | ||
|
||
TEXT ·getg(SB), NOSPLIT, $0-4 | ||
MOVL TLS, CX | ||
MOVL 0(CX)(TLS*1), AX | ||
MOVL AX, ret+0(FP) | ||
RET |