From 4ffb6b681a2f750deb79fecf7bf39451200fc01a Mon Sep 17 00:00:00 2001 From: Valentin Boulanger Date: Sat, 6 Jul 2024 15:31:15 +0200 Subject: [PATCH] fixed --- .gitea/workflows/build.yaml | 52 ------------------------------------- .gitea/workflows/check.yaml | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 52 deletions(-) delete mode 100644 .gitea/workflows/build.yaml create mode 100644 .gitea/workflows/check.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml deleted file mode 100644 index 313a8af..0000000 --- a/.gitea/workflows/build.yaml +++ /dev/null @@ -1,52 +0,0 @@ -name: Build software -run-name: ${{ github.actor }} is testing out Gitea Actions 🚀 -on: [push] - -env: - # Necessary for most environments as build failure can occur due to OOM issues - NODE_OPTIONS: "--max-old-space-size=4096" - -jobs: - prepare: - strategy: - # Failure in one platform build won't impact the others - fail-fast: false - matrix: - build: - - name: 'DMXConnect' - platform: 'linux/amd64' - os: 'ubuntu-latest' - # - name: 'DMXConnect' - # platform: 'windows/amd64' - # os: 'windows-latest' - # - name: 'DMXConnect' - # platform: 'darwin/universal' - # os: 'macos-latest' - - runs-on: ${{ matrix.build.os }} - timeout-minutes: 30 - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Build wails - uses: dAppServer/wails-build-action@v2.2 - id: build - with: - build-name: ${{ matrix.build.name }} - build-platform: ${{ matrix.build.platform }} - package: false - go-version: '1.21' - - - run: echo "This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 Job finished with status ${{ job.status }}." \ No newline at end of file diff --git a/.gitea/workflows/check.yaml b/.gitea/workflows/check.yaml new file mode 100644 index 0000000..fb2c421 --- /dev/null +++ b/.gitea/workflows/check.yaml @@ -0,0 +1,46 @@ +name: Check software + +on: [push] + +jobs: + prepare: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '^1.21.4' + + - name: Install dependencies + run: go mod tidy + + - name: Install golangci-lint + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1 + + - name: Run golangci-lint + run: | + $(go env GOPATH)/bin/golangci-lint run + + - name: Build + run: go build -v ./... + + - name: Run tests with race detector + run: go test -v -race ./... + + - name: Run tests and generate coverage report + run: go test -v -coverprofile=coverage.out ./... + + - name: Display coverage + run: go tool cover -func=coverage.out + + - name: Upload coverage report + uses: actions/upload-artifact@v3 + with: + name: coverage-report + path: coverage.out \ No newline at end of file