Skip to content

Commit

Permalink
Merge pull request #15 from corsicanec82/develop
Browse files Browse the repository at this point in the history
update config, workflow, readme
  • Loading branch information
mokevnin committed Dec 9, 2021
2 parents c2d4586 + abeac52 commit 4dc751d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 50 deletions.
44 changes: 8 additions & 36 deletions .github/workflows/Docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,18 @@ name: Docker

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]

env:
# TODO: Change variable to your registry.
REGISTRY_NAME: hexletbasics
branches:
- main

jobs:
build-test:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut

build-push-notify:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: build-test
steps:
- uses: actions/checkout@v2
- name: Set repository name
run: |
echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')" >> $GITHUB_ENV
- name: Build and push into docker hub
uses: docker/build-push-action@v1.1.0
- uses: hexlet-basics/exercises-action@release
with:
repository: ${{ env.REGISTRY_NAME }}/${{ env.REPOSITORY_NAME }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: latest
- name: Set fail Slack env vars
if: ${{ failure() }}
run: |
echo "SLACK_COLOR=#a30200" >> $GITHUB_ENV
- name: Send notification into Slack
if: ${{ always() }}
uses: rtCamp/action-slack-notify@v2.0.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ compose:
compose-build:
docker-compose build

# TODO: добавить линтер
code-lint:
# ~/bin/jb inspectcode Program.csproj

Expand All @@ -19,3 +20,16 @@ compose-bash:

compose-test:
docker-compose run exercises make test

compose-code-lint:
docker-compose run exercises make code-lint

compose-description-lint:
docker-compose run exercises make description-lint

compose-schema-validate:
docker-compose run exercises make schema-validate

ci-check:
docker-compose --file docker-compose.yml build
docker-compose --file docker-compose.yml up --abort-on-container-exit
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# hexlet-basics
# exercises-csharp

[![Github Actions Status](../../workflows/Docker/badge.svg)](../../actions)

Expand All @@ -13,6 +13,8 @@
$ make
# run
$ make compose
# check
$ make ci-check

# run tests
$ make compose-test
Expand All @@ -24,7 +26,9 @@ $ make compose-schema-validate
```

##
[![Hexlet Ltd. logo](https://raw.githubusercontent.com/Hexlet/assets/master/images/hexlet_logo128.png)](https://ru.hexlet.io/pages/about?utm_source=github&utm_medium=link&utm_campaign=exercises-javascript)
[![Hexlet Ltd. logo](https://raw.githubusercontent.com/Hexlet/assets/master/images/hexlet_logo128.png)](https://ru.hexlet.io/pages/about?utm_source=github&utm_medium=link&utm_campaign=exercises-csharp)

This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet (in Russian)](https://ru.hexlet.io/pages/about?utm_source=github&utm_medium=link&utm_campaign=exercises-javascript).
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet (in Russian)](https://ru.hexlet.io/pages/about?utm_source=github&utm_medium=link&utm_campaign=exercises-csharp).
##

See most active contributers on [hexlet-friends](https://friends.hexlet.io/).
8 changes: 8 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

version: '3'

services:
exercises:
volumes:
- .:/exercises-csharp
8 changes: 0 additions & 8 deletions docker-compose.test.yml

This file was deleted.

5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---

version: '3.7'
version: '3'

services:
exercises:
build: .
volumes:
- .:/exercises-csharp
image: hexletbasics/exercises-csharp:cached
command: make check

0 comments on commit 4dc751d

Please sign in to comment.