2022-06-17 15:05:54 +02:00
|
|
|
# SPDX-FileCopyrightText: 2022 Winni Neessen <winni@neessen.dev>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
2022-03-15 21:32:05 +01:00
|
|
|
name: Codecov workflow
|
2022-03-15 21:29:26 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-03-15 21:30:51 +01:00
|
|
|
- main
|
2022-03-15 21:29:26 +01:00
|
|
|
paths:
|
|
|
|
- '**.go'
|
|
|
|
- 'go.*'
|
2024-10-04 15:28:22 +02:00
|
|
|
- '.github/workflows/codecov.yml'
|
2022-03-15 21:29:26 +01:00
|
|
|
- 'codecov.yml'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
2022-03-15 21:30:51 +01:00
|
|
|
- main
|
2022-03-15 21:29:26 +01:00
|
|
|
paths:
|
|
|
|
- '**.go'
|
|
|
|
- 'go.*'
|
2024-10-04 15:28:22 +02:00
|
|
|
- '.github/workflows/codecov.yml'
|
2022-03-15 21:29:26 +01:00
|
|
|
- 'codecov.yml'
|
2022-03-16 21:08:34 +01:00
|
|
|
env:
|
|
|
|
TEST_HOST: ${{ secrets.TEST_HOST }}
|
2022-03-21 10:15:58 +01:00
|
|
|
TEST_FROM: ${{ secrets.TEST_USER }}
|
2022-03-21 11:03:55 +01:00
|
|
|
TEST_ALLOW_SEND: "1"
|
2022-03-16 21:08:34 +01:00
|
|
|
TEST_SMTPAUTH_USER: ${{ secrets.TEST_USER }}
|
|
|
|
TEST_SMTPAUTH_PASS: ${{ secrets.TEST_PASS }}
|
2022-03-21 10:15:58 +01:00
|
|
|
TEST_SMTPAUTH_TYPE: "LOGIN"
|
2024-10-02 15:51:56 +02:00
|
|
|
TEST_ONLINE_SCRAM: "1"
|
|
|
|
TEST_HOST_SCRAM: ${{ secrets.TEST_HOST_SCRAM }}
|
|
|
|
TEST_USER_SCRAM: ${{ secrets.TEST_USER_SCRAM }}
|
2024-10-02 16:50:45 +02:00
|
|
|
TEST_PASS_SCRAM: ${{ secrets.TEST_PASS_SCRAM }}
|
2024-03-22 15:36:47 +01:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-03-15 21:29:26 +01:00
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2024-10-03 16:01:58 +02:00
|
|
|
go: ['1.23']
|
2022-03-15 21:29:26 +01:00
|
|
|
steps:
|
2024-03-22 15:36:47 +01:00
|
|
|
- name: Harden Runner
|
2024-09-11 16:09:18 +02:00
|
|
|
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
|
2024-03-22 15:36:47 +01:00
|
|
|
with:
|
|
|
|
egress-policy: audit
|
|
|
|
|
2022-03-15 21:40:04 +01:00
|
|
|
- name: Checkout Code
|
2024-03-22 15:36:47 +01:00
|
|
|
uses: actions/checkout@61b9e3751b92087fd0b06925ba6dd6314e06f089 # master
|
2022-10-18 16:40:03 +02:00
|
|
|
- name: Setup go
|
2024-10-25 15:39:33 +02:00
|
|
|
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
|
2022-10-18 16:40:03 +02:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
2022-09-08 15:33:39 +02:00
|
|
|
- name: Install sendmail
|
2024-08-16 10:28:52 +02:00
|
|
|
if: matrix.go == '1.23' && matrix.os == 'ubuntu-latest'
|
2022-09-08 15:33:39 +02:00
|
|
|
run: |
|
|
|
|
sudo apt-get -y install sendmail; which sendmail
|
2022-03-15 21:40:04 +01:00
|
|
|
- name: Run Tests
|
|
|
|
run: |
|
2024-10-02 16:50:45 +02:00
|
|
|
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
|
2022-03-15 21:40:04 +01:00
|
|
|
- name: Upload coverage to Codecov
|
2024-08-16 10:28:52 +02:00
|
|
|
if: success() && matrix.go == '1.23' && matrix.os == 'ubuntu-latest'
|
2024-10-02 15:45:34 +02:00
|
|
|
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
|
2022-03-15 21:29:26 +01:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|