generated from OtusGolang/home_work
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (68 loc) · 2.04 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Otus homework tests
on:
push:
branches:
- hw*
env:
GO111MODULE: "on"
jobs:
lint:
runs-on: ubuntu-latest
if: ${{ !contains(github.ref, 'calendar') }}
steps:
- name: Extract branch name
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ~1.22
- name: Check out code
uses: actions/checkout@v3
- name: Linters
uses: golangci/golangci-lint-action@v3
with:
version: v1.57.2
working-directory: ${{ env.BRANCH }}
tests:
runs-on: ubuntu-latest
if: ${{ !contains(github.ref, 'calendar') }}
steps:
- name: Extract branch name
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.22
- name: Check out code
uses: actions/checkout@v3
- name: Unit tests
run: go test -v -count=1 -race -timeout=1m ./...
working-directory: ${{ env.BRANCH }}
- name: Optimization tests
run: go test -v -count=1 -timeout=1m -tags bench ./...
if: env.BRANCH == 'hw10_program_optimization'
working-directory: ${{ env.BRANCH }}
- name: Bash tests
shell: bash
run: ./test.sh
if: contains('hw01_hello_otus hw07_file_copying hw08_envdir_tool hw11_telnet_client', env.BRANCH)
working-directory: ${{ env.BRANCH }}
tests_by_makefile:
runs-on: ubuntu-latest
if: contains(github.ref, 'calendar')
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.22
- name: Check out code
uses: actions/checkout@v3
- name: make lint
run: make lint
working-directory: hw12_13_14_15_calendar
- name: make build
run: make build
working-directory: hw12_13_14_15_calendar
- name: make test
run: make test
working-directory: hw12_13_14_15_calendar