From b4aaa00517441bc40c75a539929708b1792593ea Mon Sep 17 00:00:00 2001 From: "Seraphim R. Pardee" Date: Thu, 19 Sep 2024 23:52:20 -0400 Subject: [PATCH] Add Dockerfile and test/build action. --- .gitea/workflows/test-n-build.yaml | 35 ++++++++++++++++++++++++++++++ Dockerfile | 10 +++++++++ 2 files changed, 45 insertions(+) create mode 100644 .gitea/workflows/test-n-build.yaml create mode 100644 Dockerfile diff --git a/.gitea/workflows/test-n-build.yaml b/.gitea/workflows/test-n-build.yaml new file mode 100644 index 0000000..4dc9051 --- /dev/null +++ b/.gitea/workflows/test-n-build.yaml @@ -0,0 +1,35 @@ +name: Test \'N Build +run-name: ${{ gitea.actor }} is testing... \'n building. +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + - name: setup go 1.23.1 and fetch deps + uses: actions/setup-go@v5 + with: + go-version: '1.23.1' + cache-dependency-path: go.sum + - name: do the actual test thing + run: go test -json > testresults-1.23.1.json + - name: upload test results + uses: actions/upload-artifact@v4 + with: + name: go-results-1.23.1 + path: testresults-1.23.1.json + + build: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + - name: setup go 1.23.1 and fetch deps + uses: actions/setup-go@v5 + with: + go-version: '1.23.1' + cache-dependency-path: go.sum + - name: do the actual build thing + run: go build -v ./... diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..61769da --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.23 +WORKDIR /app + +COPY * ./ +RUN go mod download + +RUN CGO_ENABLED=0 GOOS=linux go build -o /bingo + +EXPOSE 3005 +CMD [ "/bingo", "run" ]