1
0
forked from MTSR/mapserver

workflows

This commit is contained in:
BuckarooBanzay 2022-02-01 14:51:25 +01:00
parent e7528d9ace
commit 3835d3f575
3 changed files with 65 additions and 8 deletions

57
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,57 @@
name: build
on:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2.1.5
with:
go-version: 1.16
- name: Set up nodejs
uses: actions/setup-node@v2
with:
node-version: '17'
run: cd public && npm ci && npm run bundle
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Tests
run: |
go mod tidy
go test -v ./...
- name: Docker Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -10,11 +10,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: apt - name: Set up nodejs
run: sudo apt-get install -y nodejs npm uses: actions/setup-node@v2
with:
node-version: '17'
- name: jshint install - name: Run jshint
run: sudo npm i -g jshint run: cd public && npm ci && npm run jshint
- name: jshint run
run: cd public/js && jshint

View File

@ -3,6 +3,7 @@ Minetest mapserver
![](https://github.com/minetest-mapserver/mapserver/workflows/jshint/badge.svg) ![](https://github.com/minetest-mapserver/mapserver/workflows/jshint/badge.svg)
![](https://github.com/minetest-mapserver/mapserver/workflows/go-test/badge.svg) ![](https://github.com/minetest-mapserver/mapserver/workflows/go-test/badge.svg)
![](https://github.com/minetest-mapserver/mapserver/workflows/build/badge.svg)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/minetest-mapserver/mapserver) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/minetest-mapserver/mapserver)
![GitHub repo size](https://img.shields.io/github/repo-size/minetest-mapserver/mapserver.svg) ![GitHub repo size](https://img.shields.io/github/repo-size/minetest-mapserver/mapserver.svg)