-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.94 KB
/
build.yaml
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
name: Go Build and PR Management
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
env:
GO_VERSION: '1.22.6'
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
project: [bookstore-api, chatapp, databasescrud, fileserver, gin-practice, gin-server, ginnn, ginnn2, github-client-go, jsontoxecelconverter, nutrition-calculator, online-compiler, platform, postman-clone, quiz-cli, restful, server, server2, server3, sportsstore, task_processor, todoapp, url-shortener, users]
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v4
- name: Build
run: go build -ldflags="-w" ./...
working-directory: ${{ matrix.project }}
- name: Test
run: go test -v ./... 2>&1 | grep -vE "warning_pattern_here"
working-directory: ${{ matrix.project }}
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Message that will be displayed on users' first issue"
pr-message: "Message that will be displayed on users' first pull request"
welcome:
name: Welcome
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'opened'
steps:
- name: Welcome PR
uses: actions/github-script@v6
with:
script: |
const issueComment = `Hello @${{ github.actor }}, thank you for your contribution!`;
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: issueComment
});