diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..4163867d --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,35 @@ +name: build-main +on: + pull_request: + types: + - closed + +jobs: + if_merged: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + cache-dependency-path: "**/*.sum" + + - name: Install deb packages + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: protobuf-compiler + version: 1.0 + + - name: Install go packages + run: | + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 + export PATH="$PATH:$(go env GOPATH)/bin" + + - name: Build + run: | + make build \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..20115122 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,19 @@ +name: test-golang +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + cache-dependency-path: "**/*.sum" + + - name: Run tests + run: | + make test \ No newline at end of file