Skip to content

Commit

Permalink
fix: preparing tests using docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Farenheith committed Oct 27, 2024
1 parent 8b7c098 commit 8d50a1e
Show file tree
Hide file tree
Showing 20 changed files with 2,120 additions and 1,608 deletions.
62 changes: 31 additions & 31 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @Farenheith @gustavobeavis @danielgalleni @Dodt @pedrosodre @douglasdrdc @fgabrielsilva @pauloandreget

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.

# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.

# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.

# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository.
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @Farenheith @gustavobeavis @danielgalleni @Dodt @pedrosodre @douglasdrdc @fgabrielsilva @pauloandreget

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.

# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.

# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.

# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository.
44 changes: 22 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# This is a basic workflow to help you get started with Actions

name: build
on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
# This is a basic workflow to help you get started with Actions

name: build
on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
44 changes: 22 additions & 22 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# This is a basic workflow to help you get started with Actions

name: lint
on:
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: install
run: npm ci
- name: Lint
run: npm run lint
# This is a basic workflow to help you get started with Actions

name: lint
on:
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: install
run: npm ci
- name: Lint
run: npm run lint
119 changes: 63 additions & 56 deletions .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,63 @@
name: semantic-release

on:
push:
branches: [main]

env:
ConnectionStrings__SqlConnection: ${{ secrets.CONNECTIONSTRINGS__SQLCONNECTION }}

jobs:
semantic:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}}
HUSKY: 0
CI: true
steps:
- uses: actions/checkout@v4
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Prepare Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Install dependencies
run: npm ci
- name: Build
run: npm run build

- name: Prepare Db
run: npm run prepare-test-db

- name: Test
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./coverage/lcov.info
coverageLocations: ${{github.workspace}}/test/Codibre.GrpcSqlProxy.Test/coverage/lcov.info:lcov

- name: Semantic Release
run: npm i -g @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/github @semantic-release/exec @droidsolutions-oss/semantic-release-nuget @semantic-release/release-notes-generator semantic-release @semantic-release/error
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}}
HUSKY: 0
CI: true
- run: npx semantic-release --ci
- run: git push

- name: Unload Db
run: npm run unload-test-db
name: semantic-release

on:
push:
branches: [main]

env:
ConnectionStrings__SqlConnection: ${{ secrets.CONNECTIONSTRINGS__SQLCONNECTION }}

jobs:
semantic:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}}
HUSKY: 0
CI: true
steps:
- uses: actions/checkout@v4
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Prepare Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Install dependencies
run: npm ci
- name: Build
run: npm run build

- name: Prepare Db
run: npm run prepare-test-db

- name: Docker build
run: npm run docker:build
- name: Docker run
run: docker_id=$(docker run -d --network=host test-grpc-client)

- name: Test
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./coverage/lcov.info
coverageLocations: ${{github.workspace}}/test/Codibre.GrpcSqlProxy.Test/coverage/lcov.info:lcov

- name: Semantic Release
run: npm i -g @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/github @semantic-release/exec @droidsolutions-oss/semantic-release-nuget @semantic-release/release-notes-generator semantic-release @semantic-release/error
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}}
HUSKY: 0
CI: true
- run: npx semantic-release --ci
- run: git push

- name: Docker quit
run: docker kill $docker_id
- name: Unload Db
run: npm run unload-test-db
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
- name: Prepare Db
run: npm run prepare-test-db

- name: Docker build
run: npm run docker:build
- name: Docker run
run: docker_id=$(docker run -d --network=host test-grpc-client)

- name: Test
uses: paambaati/[email protected]
env:
Expand All @@ -39,5 +44,7 @@ jobs:
coverageCommand: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./coverage/lcov.info
coverageLocations: ${{github.workspace}}/test/Codibre.GrpcSqlProxy.Test/coverage/lcov.info:lcov

- name: Docker quit
run: docker kill $docker_id
- name: Unload Db
run: npm run unload-test-db
Loading

0 comments on commit 8d50a1e

Please sign in to comment.