Skip to content

Commit 8fab671

Browse files
committed
feat: Initial Commit for Moving Projects
1 parent bf70934 commit 8fab671

89 files changed

Lines changed: 15608 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: nuget
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "08:00"
8+
timezone: Asia/Jakarta
9+
open-pull-requests-limit: 100
10+
reviewers:
11+
- berviantoleo
12+
assignees:
13+
- berviantoleo
14+
15+
- package-ecosystem: npm
16+
directory: "/"
17+
schedule:
18+
interval: weekly
19+
day: saturday
20+
time: "08:00"
21+
timezone: Asia/Jakarta
22+
open-pull-requests-limit: 100
23+
reviewers:
24+
- berviantoleo
25+
assignees:
26+
- berviantoleo
27+
28+
- package-ecosystem: github-actions
29+
directory: "/"
30+
schedule:
31+
interval: weekly
32+
day: saturday
33+
time: "08:00"
34+
timezone: Asia/Jakarta
35+
open-pull-requests-limit: 100
36+
reviewers:
37+
- berviantoleo
38+
assignees:
39+
- berviantoleo
40+
41+
- package-ecosystem: docker
42+
directory: "/"
43+
schedule:
44+
interval: weekly
45+
day: saturday
46+
time: "08:00"
47+
timezone: Asia/Jakarta
48+
open-pull-requests-limit: 100
49+
reviewers:
50+
- berviantoleo
51+
assignees:
52+
- berviantoleo
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '0 3 * * 6'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37+
# Learn more:
38+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v3
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v3
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
61+
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
65+
66+
#- run: |
67+
# make bootstrap
68+
# make release
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v3

.github/workflows/codeql.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ main ]
9+
schedule:
10+
- cron: '30 1 * * 6'
11+
jobs:
12+
codeql:
13+
name: Analyze
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Initialize CodeQL
22+
uses: github/codeql-action/init@v3
23+
with:
24+
languages: csharp
25+
- name: Setup .NET Core
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: "9.0.x"
29+
- name: Autobuild
30+
uses: github/codeql-action/autobuild@v3
31+
- name: Perform CodeQL Analysis
32+
uses: github/codeql-action/analyze@v3

.github/workflows/dotnet.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Dotnet
2+
on:
3+
push:
4+
branches: [ main ]
5+
tags:
6+
- v*
7+
pull_request:
8+
branches: [ main ]
9+
env:
10+
ConnectionStrings__Default: "Host=localhost;Database=personalwebapi_test;Username=postgres;Password=testpass123"
11+
jobs:
12+
build:
13+
runs-on: ubuntu-24.04
14+
services:
15+
psql:
16+
image: postgres:17-alpine
17+
env:
18+
POSTGRES_PASSWORD: testpass123
19+
POSTGRES_DB: personalwebapi_test
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
ports:
26+
- 5432:5432
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Setup .NET Core
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
dotnet-version: "9.0.x"
33+
- name: Install dependencies
34+
run: dotnet restore
35+
- name: Build
36+
run: dotnet build --configuration Release --no-restore
37+
- name: Migrate DB
38+
run: |
39+
dotnet tool install --global dotnet-ef
40+
dotnet tool restore
41+
dotnet ef database update --project PersonalWebApi
42+
- name: Test
43+
run: dotnet test --configuration Release --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage"
44+
- name: Report Codecov
45+
uses: codecov/codecov-action@v5

.github/workflows/nodejs.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
name: Node.js CI
4+
on:
5+
push:
6+
branches: [main]
7+
tags:
8+
- v*
9+
pull_request:
10+
branches: [main]
11+
env:
12+
# TODO: Change variable to your image's name.
13+
IMAGE_NAME: personal-web-admin
14+
jobs:
15+
build:
16+
runs-on: ubuntu-24.04
17+
strategy:
18+
matrix:
19+
node-version: [20.x, 22.x]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- name: Yarn build & test
27+
run: |
28+
yarn --frozen-lockfile
29+
yarn test --coverage
30+
yarn build
31+
- name: Codecov
32+
if: ${{ matrix.node-version == '20.x' }}
33+
run: bash <(curl -s https://codecov.io/bash)
34+
docker-test:
35+
runs-on: ubuntu-24.04
36+
if: github.event_name == 'pull_request'
37+
needs: build
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Run tests
41+
run: docker build . --file Dockerfile
42+
docker-push:
43+
# Ensure test job passes before pushing image.
44+
needs: build
45+
runs-on: ubuntu-24.04
46+
if: github.event_name == 'push'
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Login to Docker Hub
50+
uses: docker/login-action@v3
51+
with:
52+
username: ${{ secrets.DOCKER_USERNAME }}
53+
password: ${{ secrets.DOCKER_TOKEN }}
54+
- name: Log in to the Container registry
55+
uses: docker/login-action@v3
56+
with:
57+
registry: ghcr.io
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
- name: Extract metadata (tags, labels) for Docker
61+
id: meta
62+
uses: docker/metadata-action@v5
63+
with:
64+
images: |
65+
bervproject/${{ env.IMAGE_NAME }}
66+
ghcr.io/${{ github.repository }}
67+
- name: Build and push Docker images
68+
uses: docker/build-push-action@v6
69+
with:
70+
context: .
71+
push: true
72+
tags: ${{ steps.meta.outputs.tags }}
73+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)