-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
132 additions
and
2 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 @@ | ||
.github |
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,87 @@ | ||
name: End to End Tests | ||
|
||
on: | ||
pull_request: | ||
|
||
env: | ||
TAR_PATH: /tmp/docker-image.tar | ||
TAR_NAME: docker-image | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64 | ||
tags: noble-forwarding-simd:local | ||
# Export tarball image to upload and share with other runners | ||
outputs: type=docker,dest=${{ env.TAR_PATH }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Publish Tarball as Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.TAR_NAME }} | ||
path: ${{ env.TAR_PATH }} | ||
|
||
prepare-e2e-tests: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go 1.22 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^1.22' | ||
|
||
- name: Generate matrix | ||
id: set-matrix | ||
run: | | ||
# Run the command and convert its output to a JSON array | ||
TESTS=$(cd e2e && go test -list . | grep -v "^ok " | jq -R -s -c 'split("\n")[:-1]') | ||
echo "matrix=${TESTS}" >> $GITHUB_OUTPUT | ||
e2e-tests: | ||
needs: | ||
- build-docker | ||
- prepare-e2e-tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# names of `make` commands to run tests | ||
test: ${{fromJson(needs.prepare-e2e-tests.outputs.matrix)}} | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Set up Go 1.22 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^1.22' | ||
|
||
- name: checkout chain | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Tarball Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ env.TAR_NAME }} | ||
|
||
- name: Load Docker Image | ||
run: docker image load -i ${{ env.TAR_PATH }} | ||
|
||
- name: run test | ||
run: cd e2e && go test -race -v -timeout 30m -run ^${{ matrix.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
unit-tests: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ^1.21 | ||
|
||
- name: Run Unit Tests | ||
run: go test -v ./... |
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,23 @@ | ||
# this docker file is currently only used for github actions e2e testing | ||
|
||
|
||
FROM golang:1.22-alpine3.18 as builder | ||
|
||
RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make; | ||
|
||
ENV GOPATH="" | ||
|
||
# need to copy entire repo app becuase of replace statement in the simapp go.mod | ||
COPY . / | ||
|
||
WORKDIR /simapp | ||
|
||
RUN go mod download | ||
|
||
RUN make build | ||
|
||
FROM alpine:3.18 | ||
|
||
COPY --from=builder /simapp/build/simd /bin/simd | ||
|
||
ENTRYPOINT ["simd"] |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
- name: noble-forwarding-simd | ||
dockerfile: cosmos | ||
build-target: make build | ||
build-dir: simapp | ||
binaries: | ||
- simapp/build/simd |
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