-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
ce98ad4
commit 21898b3
Showing
4 changed files
with
103 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,41 @@ | ||
name: autotests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
|
||
autotest: | ||
runs-on: ubuntu-latest | ||
container: golang:1.22 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download autotests binaries | ||
uses: robinraju/[email protected] | ||
with: | ||
repository: Yandex-Practicum/go-autotests | ||
latest: true | ||
fileName: "*" | ||
out-file-path: .tools | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup autotest binary | ||
run: | | ||
chmod -R +x $GITHUB_WORKSPACE/.tools | ||
mv $GITHUB_WORKSPACE/.tools/devopsmastertest /usr/local/bin/devopsmastertest | ||
- name: Build script binary | ||
run: | | ||
go build -buildvcs=false -o srvmonitor | ||
- name: Run autotest suite | ||
run: | | ||
devopsmastertest \ | ||
-test.v \ | ||
-test.run=^TestLesson01$ \ | ||
-binary-path=./srvmonitor | ||
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,31 @@ | ||
name: go vet test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
statictest: | ||
runs-on: ubuntu-latest | ||
container: golang:1.22 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download statictest binary | ||
uses: robinraju/[email protected] | ||
with: | ||
repository: Yandex-Practicum/go-autotests | ||
latest: true | ||
fileName: statictest | ||
out-file-path: .tools | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- 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 |
---|---|---|
@@ -1,2 +1,30 @@ | ||
# go-devops-engineer-magistr-lesson1-tpl | ||
|
||
Шаблон репозитория для практического задания курса "DevOps-инженер облачных сервисов" | ||
|
||
## Начало работы | ||
|
||
1. Склонируйте репозиторий в любую подходящую директорию на вашем компьютере. | ||
2. В корне репозитория выполните команду `go mod init <name>` (где `<name>` — адрес вашего репозитория на GitHub без префикса `https://`) для создания модуля. | ||
|
||
## Обновление шаблона | ||
|
||
Чтобы иметь возможность получать обновления автотестов и других частей шаблона, выполните команду: | ||
|
||
``` | ||
git remote add -m main template https://github.com/Yandex-Practicum/go-devops-engineer-magistr-lesson1-tpl.git | ||
``` | ||
|
||
Для обновления кода автотестов выполните команду: | ||
|
||
``` | ||
git fetch template && git checkout template/main .github | ||
``` | ||
|
||
Затем добавьте полученные изменения в свой репозиторий. | ||
|
||
## Запуск автотестов | ||
|
||
Автотесты запускаются на любой коммит в репозиторий. | ||
|
||
Подробнее про локальный и автоматический запуск читайте в [README автотестов](https://github.com/Yandex-Practicum/go-autotests). |
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,3 @@ | ||
package main | ||
|
||
func main() {} |