Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.

Commit 1053dad

Browse files
committed
feat: initial commit
0 parents  commit 1053dad

31 files changed

+35708
-0
lines changed

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
sourceType: 'module',
6+
},
7+
plugins: ['@typescript-eslint/eslint-plugin'],
8+
extends: [
9+
'plugin:@typescript-eslint/recommended',
10+
'prettier/@typescript-eslint',
11+
'plugin:prettier/recommended',
12+
],
13+
root: true,
14+
env: {
15+
node: true,
16+
jest: true,
17+
},
18+
ignorePatterns: ['.eslintrc.js'],
19+
rules: {
20+
'@typescript-eslint/interface-name-prefix': 'off',
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
'@typescript-eslint/explicit-module-boundary-types': 'off',
23+
'@typescript-eslint/no-explicit-any': 'off',
24+
},
25+
};

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Nicklason

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node-version: [14.x]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Use NodeJS ${{ matrix.node-version }}
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: ${{ matrix.node-version }}
17+
- name: Cache npm dependencies
18+
uses: actions/cache@v2
19+
with:
20+
path: '~/.npm'
21+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-node-
24+
- name: npm install
25+
run: npm ci
26+
- name: npm build
27+
run: npm run build
28+
unit-tests:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
node-version: [14.x]
33+
needs: [build]
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Use NodeJS ${{ matrix.node-version }}
37+
uses: actions/setup-node@v1
38+
with:
39+
node-version: ${{ matrix.node-version }}
40+
- name: Cache npm dependencies
41+
uses: actions/cache@v2
42+
with:
43+
path: '~/.npm'
44+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
45+
restore-keys: |
46+
${{ runner.os }}-node-
47+
- name: npm install
48+
run: npm ci
49+
- name: npm test
50+
run: npm run test
51+
e2e-test:
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
node-version: [14.x]
56+
needs: [unit-tests]
57+
steps:
58+
- uses: actions/checkout@v1
59+
- name: Use Node.js ${{ matrix.node-version }}
60+
uses: actions/setup-node@v1
61+
with:
62+
node-version: ${{ matrix.node-version }}
63+
- name: Start Docker-Compose
64+
run: docker-compose up -d
65+
- name: Cache npm dependencies
66+
uses: actions/cache@v2
67+
with:
68+
path: '~/.npm'
69+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
70+
restore-keys: |
71+
${{ runner.os }}-node-
72+
- name: npm install
73+
run: npm ci
74+
- name: Run tests
75+
run: npm run test:e2e
76+
- name: Stop Docker-Compose
77+
run: docker-compose down

.github/workflows/release.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Release
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CI"]
6+
branches: [main]
7+
types:
8+
- completed
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
outputs:
15+
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
16+
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v1
20+
- name: Cache npm dependencies
21+
uses: actions/cache@v2
22+
with:
23+
path: '~/.npm'
24+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-node-
27+
- name: npm install
28+
run: npm ci
29+
- name: Release
30+
uses: cycjimmy/semantic-release-action@v2
31+
id: semantic
32+
with:
33+
semantic_version: 17
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
push_to_registry:
37+
runs-on: ubuntu-latest
38+
needs: [release]
39+
if: needs.release.outputs.new_release_published == 'true'
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v2
43+
- name: Set up QEMU
44+
uses: docker/setup-qemu-action@v1
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v1
47+
- name: Cache Docker layers
48+
uses: actions/cache@v2
49+
with:
50+
path: /tmp/.buildx-cache
51+
key: ${{ runner.os }}-buildx-${{ github.sha }}
52+
restore-keys: |
53+
${{ runner.os }}-buildx-
54+
- name: Login to GitHub Container Registry
55+
uses: docker/login-action@v1
56+
with:
57+
registry: ghcr.io
58+
username: ${{ github.repository_owner }}
59+
password: ${{ secrets.CR_PAT }}
60+
- name: Build and push
61+
uses: docker/build-push-action@v2
62+
with:
63+
context: .
64+
file: ./Dockerfile
65+
push: true
66+
tags: |
67+
ghcr.io/nicklason/tf2-schema-worker:latest
68+
ghcr.io/nicklason/tf2-schema-worker:${{ needs.release.outputs.new_release_version }}
69+
cache-from: type=local,src=/tmp/.buildx-cache
70+
cache-to: type=local,dest=/tmp/.buildx-cache

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# OS
14+
.DS_Store
15+
16+
# Tests
17+
/coverage
18+
/.nyc_output
19+
20+
# IDEs and editors
21+
/.idea
22+
.project
23+
.classpath
24+
.c9/
25+
*.launch
26+
.settings/
27+
*.sublime-workspace
28+
29+
# IDE - VSCode
30+
.vscode/*
31+
!.vscode/settings.json
32+
!.vscode/tasks.json
33+
!.vscode/launch.json
34+
!.vscode/extensions.json
35+
36+
*.env
37+
!.test.env

.huskyrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
"hooks": {
3+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
4+
}
5+
};

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"endOfLine": "auto"
5+
}

.releaserc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/github"
6+
],
7+
"branches": ["main"]
8+
};

.test.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
STEAM_API_KEY="1234"
2+
3+
QUEUE_HOST=localhost
4+
QUEUE_PORT=6379
5+
QUEUE_PASSWORD=test
6+
7+
SCHEMA_SERVICE_URL=http://localhost:3000

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"orta.vscode-jest"
4+
]
5+
}

0 commit comments

Comments
 (0)