goext/.gitea/workflows/tests.yml

56 lines
1.5 KiB
YAML
Raw Normal View History

2023-08-14 18:39:22 +02:00
# https://docs.gitea.com/next/usage/actions/quickstart
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
name: Build Docker and Deploy
run-name: Build & Deploy ${{ gitea.ref }} on ${{ gitea.actor }}
2023-11-13 15:34:58 +01:00
on:
push:
branches:
- '*'
- '**'
2023-08-14 18:39:22 +02:00
jobs:
run_tests:
name: Run goext test-suite
2023-08-14 18:39:22 +02:00
runs-on: bfb-cicd-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v4
with:
go-version-file: '${{ gitea.workspace }}/go.mod'
2023-08-14 18:39:22 +02:00
- name: Setup packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: curl python3
version: 1.0
- name: go version
run: go version
2023-08-14 18:39:22 +02:00
- name: Run tests
run: cd "${{ gitea.workspace }}" && make test
2023-08-14 18:39:22 +02:00
2023-11-13 15:34:58 +01:00
- name: Send failure mail
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.fastmail.com
server_port: 465
secure: true
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: Pipeline on '${{ gitea.repository }}' failed
to: ${{ steps.commiter_info.outputs.MAIL }}
from: Gitea Actions <gitea_actions@blackforestbytes.de>
body: "Go to https://gogs.blackforestbytes.com/${{ gitea.repository }}/actions"