generated from yandex-praktikum/go-musthave-diploma-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4179694
Showing
11 changed files
with
528 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: gophermart | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
container: golang:1.19 | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: praktikum | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 5s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download autotests binaries | ||
uses: robinraju/[email protected] | ||
with: | ||
repository: Yandex-Practicum/go-autotests-bin | ||
latest: true | ||
fileName: "*" | ||
out-file-path: .tools | ||
|
||
- name: Setup autotest binary | ||
run: | | ||
chmod -R +x $GITHUB_WORKSPACE/.tools | ||
mv $GITHUB_WORKSPACE/.tools/gophermarttest /usr/local/bin/gophermarttest | ||
mv $GITHUB_WORKSPACE/.tools/random /usr/local/bin/random | ||
- name: Prepare binaries | ||
run: | | ||
(cd cmd/gophermart && go build -buildvcs=false -o gophermart) | ||
(cd cmd/accrual && chmod +x accrual_linux_amd64) | ||
- name: Test | ||
run: | | ||
gophermarttest \ | ||
-test.v -test.run=^TestGophermart$ \ | ||
-gophermart-binary-path=cmd/gophermart/gophermart \ | ||
-gophermart-host=localhost \ | ||
-gophermart-port=8080 \ | ||
-gophermart-database-uri="postgresql://postgres:postgres@postgres/praktikum?sslmode=disable" \ | ||
-accrual-binary-path=cmd/accrual/accrual_linux_amd64 \ | ||
-accrual-host=localhost \ | ||
-accrual-port=$(random unused-port) \ | ||
-accrual-database-uri="postgresql://postgres:postgres@postgres/praktikum?sslmode=disable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: go vet test | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
|
||
jobs: | ||
|
||
statictest: | ||
runs-on: ubuntu-latest | ||
container: golang:1.19 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download statictest binary | ||
uses: robinraju/release-downloader@v1 | ||
with: | ||
repository: Yandex-Practicum/go-autotests-bin | ||
latest: true | ||
fileName: statictest | ||
out-file-path: .tools | ||
|
||
- name: Setup autotest binary | ||
run: | | ||
chmod -R +x $GITHUB_WORKSPACE/.tools/statictest | ||
mv $GITHUB_WORKSPACE/.tools/statictest /usr/local/bin/statictest | ||
- name: Run statictest | ||
run: | | ||
go vet -vettool=$(which statictest) ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Binaries | ||
cmd/gophermart/main | ||
cmd/gophermart/gophermart | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
|
||
# IDEs directories | ||
.idea | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# go-musthave-diploma-tpl | ||
|
||
Шаблон репозитория для индивидуального дипломного проекта курса «Go-разработчик» | ||
|
||
# Начало работы | ||
|
||
1. Склонируйте репозиторий в любую подходящую директорию на вашем компьютере. | ||
2. В корне репозитория выполните команду `go mod init <name>` (где `<name>` — адрес вашего репозитория на GitHub без | ||
префикса `https://`) для создания модуля | ||
|
||
# Обновление шаблона | ||
|
||
Чтобы иметь возможность получать обновления автотестов и других частей шаблона, выполните команду: | ||
|
||
``` | ||
git remote add -m master template https://github.com/yandex-praktikum/go-musthave-diploma-tpl.git | ||
``` | ||
|
||
Для обновления кода автотестов выполните команду: | ||
|
||
``` | ||
git fetch template && git checkout template/master .github | ||
``` | ||
|
||
Затем добавьте полученные изменения в свой репозиторий. |
Oops, something went wrong.