Fix tests #121
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Transfer Me It | |
on: [push] | |
jobs: | |
test: | |
name: Test with go version | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
matrix: | |
go: ['1.12', '1.13', '1.14'] | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Fetch cached dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Test | |
env: | |
session_key: "UH9ax500yN4mnTO60WLY2ae943tsqzFw" | |
db: "root:root@" | |
run: go test ./... -v | |
- uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
deploy: | |
name: Deploy | |
if: github.ref == 'refs/heads/master' | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: github | |
key: ${{ secrets.KEY }} | |
script: | | |
sudo /root/transfermeit-backend/deploy.sh ${{ github.sha }} |