Skip to content

Commit b103987

Browse files
authored
Merge pull request #16 from gatici/TELCO-880-add-github-workflows
Adding Github workflows and dependabot.yaml
2 parents d619a45 + c29e844 commit b103987

File tree

9 files changed

+495
-1181
lines changed

9 files changed

+495
-1181
lines changed

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2023 Canonical Ltd.
3+
4+
version: 2
5+
updates:
6+
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
12+
- package-ecosystem: "docker"
13+
directory: "/mongoapi/dbtestapp/"
14+
schedule:
15+
interval: "weekly"
16+
17+
- package-ecosystem: "gomod"
18+
directory: "/"
19+
schedule:
20+
interval: "weekly"
21+
22+
- package-ecosystem: "gomod"
23+
directory: "/mongoapi/dbtestapp"
24+
schedule:
25+
interval: "weekly"

.github/workflows/master.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2023 Canonical Ltd.
3+
4+
name: Master workflow
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
push:
11+
branches:
12+
- main
13+
14+
jobs:
15+
build-dbtestapp:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-go@v5
21+
with:
22+
go-version-file: 'go.mod'
23+
24+
- name: Build
25+
run: |
26+
cd mongoapi/dbtestapp/
27+
go build ./...
28+
29+
docker-build-dbtestapp:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: actions/setup-go@v5
35+
with:
36+
go-version-file: 'go.mod'
37+
38+
- name: Build Docker image
39+
run: |
40+
cd mongoapi/dbtestapp
41+
make docker-build
42+
43+
build:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- uses: actions/setup-go@v5
49+
with:
50+
go-version-file: 'go.mod'
51+
52+
- name: Build
53+
run: go build ./...
54+
55+
lint:
56+
name: lint
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- uses: actions/setup-go@v5
62+
with:
63+
go-version-file: 'go.mod'
64+
65+
- name: golangci-lint
66+
uses: golangci/[email protected]
67+
with:
68+
version: latest
69+
args: -v --config ./.golangci.yml
70+
71+
lint-dbtestapp:
72+
name: lint-dbtestapp
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v4
76+
77+
- uses: actions/setup-go@v5
78+
with:
79+
go-version-file: 'go.mod'
80+
81+
- name: golangci-lint
82+
uses: golangci/[email protected]
83+
with:
84+
version: latest
85+
args: -v --config ../../.golangci.yml
86+
working-directory: ./mongoapi/dbtestapp
87+
88+
license-check:
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v4
92+
93+
- name: reuse lint
94+
uses: fsfe/reuse-action@v2
95+
96+
fossa-check:
97+
runs-on: ubuntu-latest
98+
steps:
99+
- uses: actions/checkout@v4
100+
101+
- name: FOSSA scan
102+
uses: fossa-contrib/fossa-action@v3
103+
with:
104+
fossa-api-key: 9dc8fa92e3dd565687317beb87b56d89
105+
106+
unit-tests:
107+
runs-on: ubuntu-latest
108+
steps:
109+
- uses: actions/checkout@v4
110+
111+
- uses: actions/setup-go@v5
112+
with:
113+
go-version-file: 'go.mod'
114+
115+
- name: Unit tests
116+
run: go test ./...

0 commit comments

Comments
 (0)