diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..4aab8548 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,28 @@ +name: Test, Lint, Build + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 + with: + go-version: '1.15.x' + + - name: Test + run: make test + + - name: Lint + run: make lint + + - name: Build server + if: always() + run: make build-binary + + - name: Build cli + if: always() + run: make build-cli diff --git a/Makefile b/Makefile index 400cfb83..5e4e5554 100644 --- a/Makefile +++ b/Makefile @@ -93,12 +93,12 @@ out/image-id: Dockerfile tmp/.linted.sentinel > DOCKER_BUILDKIT=1 docker build --tag="$${image_id}" . > echo "$${image_id}" > out/image-id -# Main server binary - re-build if the lint output is re-run. -$(binary_name): tmp/.linted.sentinel +# Main server binary +$(binary_name): > go build -mod=vendor # CLI binary - re-build if the lint output is re-run. -mservctl/mservctl: tmp/.linted.sentinel +mservctl/mservctl: > cd mservctl > go build -mod=vendor