diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b8fddaa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: Release + +on: + push: + branches: [ master ] + +env: + VERSION: 1.2.${{ github.run_id }} + +jobs: + Release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: framebassman + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Sentry Release + uses: getsentry/action-release@v1.0.0 + with: + finalize: false + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: kolenka-inc + SENTRY_PROJECT: izzy + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: framebassman/izzy:${{ env.VERSION }} + + - uses: avakar/tag-and-release@v1 + with: + tag_name: ${{ env.VERSION }} + release_name: ${{ env.VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Sentry Release + uses: getsentry/action-release@v1.0.0 + with: + finalize: true + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: kolenka-inc + SENTRY_PROJECT: izzy diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d80bc25 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,50 @@ +name: Tests + +on: + push: + pull_request: + branches: [ master ] + paths: + - '**.cs' + - '**.csproj' + - 'Izzy.Web/Client' + +env: + DOTNET_VERSION: '3.1' # The .NET SDK version to use + +jobs: + backend: + name: build-and-test-${{matrix.os}} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Install dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test Izzy.Web.Tests --no-restore --verbosity normal + frontend: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + working-directory: ./Izzy.Web/Client + - run: npm run build --if-present + working-directory: ./Izzy.Web/Client + - run: npm test + working-directory: ./Izzy.Web/Client diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2ed91a4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -jobs: - include: - - stage: Test - language: csharp - dist: xenial - mono: none - dotnet: 3.1 - install: - - dotnet clean - - dotnet restore - script: - - dotnet build - - dotnet test Izzy.Web.Tests - - - language: node_js - node_js: - - 12.15.0 - before_install: - - cd Izzy.Web/Client/ - install: - - npm install - script: - - npm test - - - stage: Deploy - language: minimal - services: - - docker - env: - - RELEASE_NUMBER=1.1.$TRAVIS_BUILD_NUMBER - script: - - docker build --file ./Dockerfile . --tag framebassman/izzy:$RELEASE_NUMBER - - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - - docker push framebassman/izzy - before_deploy: - - git config --local user.name $GIT_USERNAME - - git config --local user.email $GIT_EMAIL - - git tag $RELEASE_NUMBER - deploy: - provider: releases - api_key: $GITHUB_OAUTH_TOKEN - skip_cleanup: true - -stages: - - Test - - name: Deploy - if: branch = master AND type != pull_request -branches: - only: - - /.*/ -notifications: - email: false diff --git a/Dockerfile b/Dockerfile index 5fce1fe..22ac44d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1.201-alpine3.11 AS build-env -RUN apk add --update 'nodejs=12.15.0-r1' 'npm=12.15.0-r1' +RUN apk add --update 'nodejs>12.15.0-r1' 'npm>12.15.0-r1' COPY ./Izzy.Web /app WORKDIR /app diff --git a/Izzy.Web/Client/src/components/incomes/Incomes.tsx b/Izzy.Web/Client/src/components/incomes/Incomes.tsx index 57929ac..424ab8f 100644 --- a/Izzy.Web/Client/src/components/incomes/Incomes.tsx +++ b/Izzy.Web/Client/src/components/incomes/Incomes.tsx @@ -2,7 +2,6 @@ import React, { Component } from 'react'; import Button from '@material-ui/core/Button'; import FormControl from '@material-ui/core/FormControl'; import TextField from '@material-ui/core/TextField'; -import Input from '@material-ui/core/Input'; import { Formik, Form, Field, FieldArray, FieldProps } from 'formik'; import './Person.css'; import { RandomPerson } from '../../store/model/RandomPerson'; diff --git a/Izzy.Web/Client/src/components/outcomes/Outcomes.tsx b/Izzy.Web/Client/src/components/outcomes/Outcomes.tsx index 6588d9c..8c161ad 100644 --- a/Izzy.Web/Client/src/components/outcomes/Outcomes.tsx +++ b/Izzy.Web/Client/src/components/outcomes/Outcomes.tsx @@ -4,7 +4,6 @@ import TableBody from '@material-ui/core/TableBody'; import TableCell from '@material-ui/core/TableCell'; import TableHead from '@material-ui/core/TableHead'; import TableRow from '@material-ui/core/TableRow'; -import Button from '@material-ui/core/Button'; import FormControl from '@material-ui/core/FormControl'; import {Transfers} from './Transfers';