From 3e7280fb44e702121fa7f97761ce9d8bdf968651 Mon Sep 17 00:00:00 2001 From: Kisaragi-ng <88741696+Kisaragi-ng@users.noreply.github.com> Date: Sun, 8 Oct 2023 11:04:40 +0900 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1c5d14d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build and Test + +on: + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.21' + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: 'v1.54' + args: --timeout=30m + continue-on-error: true + + security-check: + needs: lint + runs-on: ubuntu-latest + env: + GO111MODULE: on + steps: + - name: Checkout Source + uses: actions/checkout@v3 + - name: Run Gosec Security Scanner + uses: securego/gosec@master + with: + args: ./... + continue-on-error: true + + build: + needs: security-check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: | + sudo apt-get update + sudo apt-get install -y git gcc musl-dev libsqlite3-dev + go mod download + CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o scanlation-discord-bot . + - name: Artifacts + uses: actions/upload-artifact@v2 + with: + name: scanlation-discord-bot + path: scanlation-discord-bot