mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2024-12-31 03:11:17 +02:00
70 lines
2.1 KiB
YAML
70 lines
2.1 KiB
YAML
on: [push, pull_request]
|
|
env:
|
|
factorio_password: ${{ secrets.FACTORIO_USERNAME }}
|
|
factorio_username: ${{ secrets.FACTORIO_PASSWORD }}
|
|
jobs:
|
|
test-npm:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
- run: make app/bundle
|
|
test-go:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
go: ['1.14', '1.15', '1']
|
|
runs-on: ${{ matrix.os }}
|
|
name: test-go ${{ matrix.go }} (${{ matrix.os }})
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
- if: contains(matrix.os, 'ubuntu')
|
|
run: |
|
|
cd src
|
|
if [[ -z "$factorio_password" ]]; then
|
|
echo "run only short tests"
|
|
go test ./... -v -test.short
|
|
else
|
|
echo "run full test suit"
|
|
go test ./... -v
|
|
fi
|
|
- if: contains(matrix.os, 'windows')
|
|
run: |
|
|
cd src
|
|
IF DEFINED factorio_password (
|
|
echo "run full test suit"
|
|
go test ./... -v
|
|
) ELSE (
|
|
echo "run only short tests"
|
|
go test ./... -v -test.short
|
|
)
|
|
docker-push:
|
|
needs: [test-npm, test-go]
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
- uses: actions/setup-go@v2
|
|
- uses: docker/setup-buildx-action@v1
|
|
- name: Login to dockerhub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- run: make build; cp build/factorio-server-manager-linux.zip docker/factorio-server-manager-linux.zip
|
|
- id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: ./docker/
|
|
file: ./docker/Dockerfile-local
|
|
push: true
|
|
tags: ofsm/ofsm:develop
|