-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: adding a new unit test workflow
- Loading branch information
Showing
6 changed files
with
119 additions
and
44 deletions.
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Unit Test | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
GO_VERSION: 1.23.4 | ||
steps: | ||
- name: Checkout current repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
path: gateway | ||
|
||
- name: Checkout framework repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
repository: infinilabs/framework | ||
path: framework | ||
|
||
- name: Checkout framework-vendor | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
fetch-depth: 0 | ||
repository: infinilabs/framework-vendor | ||
path: vendor | ||
|
||
- name: Set up go toolchain | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
check-latest: false | ||
cache: true | ||
|
||
- name: Check go toolchain | ||
run: go version | ||
|
||
- name: Unit test | ||
env: | ||
GOFLAGS: -tags=ci | ||
run: | | ||
echo Home path is $HOME | ||
export WORKBASE=$HOME/go/src/infini.sh | ||
export WORK=$WORKBASE/gateway | ||
# for test workspace | ||
mkdir -p $HOME/go/src/ | ||
ln -s $GITHUB_WORKSPACE $WORKBASE | ||
# check work folder | ||
ls -lrt $WORKBASE/ | ||
ls -alrt $WORK | ||
# for unit test | ||
cd $WORK | ||
echo Testing code at $PWD ... | ||
make test |
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
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
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
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
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