Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrodriges committed Oct 2, 2024
0 parents commit b7bee29
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/autotest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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/release-downloader@v1.8
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 yamlvalidator
- name: Run autotest suite
run: |
devopsmastertest \
-test.v \
-test.run=^TestLesson02$ \
-binary-path=./yamlvalidator
31 changes: 31 additions & 0 deletions .github/workflows/statictest.yml
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/release-downloader@v1.8
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) ./...
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# 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

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

# env file
.env
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# go-devops-engineer-magistr-lesson2-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-lesson2-tpl.git
```

Для обновления кода автотестов выполните команду:

```
git fetch template && git checkout template/main .github
```

Затем добавьте полученные изменения в свой репозиторий.

## Запуск автотестов

Автотесты запускаются на любой коммит в репозиторий.

Подробнее про локальный и автоматический запуск читайте в [README автотестов](https://github.com/Yandex-Practicum/go-autotests).
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package main

func main() {}

0 comments on commit b7bee29

Please sign in to comment.