diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..e34c843 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,82 @@ +name: CI +on: + push: + pull_request: + schedule: + - cron: "0 0 * * 0" + +jobs: + test: + name: Test + strategy: + matrix: + go-version: + - "1.15" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout/@v2 + + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + + - name: Cache go modules + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go-mod- + + - name: Install dependencies + run: go mod vendor -v + + - name: Run go test + run: go test -ldflags "-s -w" -coverprofile coverage.txt -covermode atomic ./cmd/... ./pkg/... + + - name: Check coverage.txt existence + id: check-coverage-file + if: ${{ always() }} + uses: andstor/file-existence-action@v1 + with: + files: coverage.txt + + - name: Upload coverage as artifacts + if: ${{ always() && steps.check-coverage-file.outputs.files_exists == 'true' }} + uses: actions/upload-artifact@v2 + with: + name: coverage-${{ matrix.go-version }} + path: coverage.txt + + - name: Upload coverage to Codecov + if: ${{ always() && steps.check-coverage-file.outputs.files_exists == 'true' }} + uses: codecov/codecov-action@v1 + with: + name: coverage-${{ matrix.go-version }} + file: coverage.txt + + vet: + name: Vet + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout/@v2 + + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: "1.15" + + - name: Cache go modules + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go-mod- + + - name: Install dependencies + run: go mod vendor -v + + - name: Run go vet + run: go vet -ldflags "-s -w" ./cmd/... ./pkg/... diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1073538..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go - -go: - - "1.14" - -script: - - go test -ldflags "-s -w" ./cmd/... ./pkg/... - - go vet -ldflags "-s -w" ./cmd/... ./pkg/... \ No newline at end of file diff --git a/README.md b/README.md index c7f406c..87c46bc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -# Factorio Item Browser - Export Icon Renderer +![Factorio Item Browser](https://raw.githubusercontent.com/factorio-item-browser/documentation/master/asset/image/logo.png) + +# Export Icon Renderer + +[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/factorio-item-browser/export-icon-renderer)](https://github.com/factorio-item-browser/export-icon-renderer/releases) +[![GitHub](https://img.shields.io/github/license/factorio-item-browser/export-icon-renderer)](LICENSE.md) +[![build](https://img.shields.io/github/workflow/status/factorio-item-browser/export-icon-renderer/CI?logo=github)](https://github.com/factorio-item-browser/export-icon-renderer/actions) +[![Codecov](https://img.shields.io/codecov/c/gh/factorio-item-browser/export-icon-renderer?logo=codecov)](https://codecov.io/gh/factorio-item-browser/export-icon-renderer) This project implements the icon renderer of the export in Go for fast processing of the images as layers. The icon renderer was first part of the exporter itself (i.e. PHP), but after discovering performance issues especially with diff --git a/go.mod b/go.mod index 858390e..9f76d40 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/factorio-item-browser/export-icon-renderer -go 1.14 +go 1.15 require ( github.com/anthonynsimon/bild v0.11.2-0.20200422162521-c58fb61a4c52