Skip to content

Commit

Permalink
Merge pull request #34 from caffeine-addictt/feature/typescript
Browse files Browse the repository at this point in the history
Using typescript
  • Loading branch information
caffeine-addictt committed Apr 29, 2024
2 parents 55a7670 + 33d7e60 commit ed143fd
Show file tree
Hide file tree
Showing 15 changed files with 5,525 additions and 371 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/*
42 changes: 42 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check Transpiled JavaScript

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

jobs:
check-dist:
name: dist/ up to date
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/[email protected]
with:
cache: npm

- name: Install Dependencies
run: npm i

- name: Build dist/ Directory
run: npm run build

# This will fail the workflow if the `dist/` directory is different than
# expected.
- name: Compare Directories
run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
exit 1
fi
71 changes: 16 additions & 55 deletions .github/workflows/test-worker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Test Suite
name: Run Tests

on:
push:
Expand All @@ -16,9 +16,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
# This test suite will run for every language version for every OS defined in the matrix
tests-os-matrix:
name: '${{ matrix.language_version }} on ${{ matrix.os }}'
tests:
name: 'Node.Js ${{ matrix.node_version }} on ${{ matrix.os }}'
runs-on: '${{ matrix.os }}-latest'

strategy:
Expand All @@ -28,76 +27,38 @@ jobs:
- ubuntu
- windows
- macos
# Place your language versions you want to test
language_version: ['v1.0.0', 'v2.0.0']

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Setup your language (This is specific to each language)
# - name: Set up language ${{ matrix.language_version }}
# uses: actions/setup-python@v5
# with:
# language-version: ${{ matrix.language_version }}

- name: Install dependencies
run: |
set -xe
echo "Installed dependencies"
# python -m pip install -r requirements.txt (for example)
- name: Build project
run: |
set -xe
echo "Building"
# Place your code to build your project here
- name: Testing
run: |
set -xe
echo "Testing project"
# Place your code to test your project here
# This test will run once
tests:
name: 'Testing'
runs-on: ubuntu-latest
node_version:
- 16
- 18
- 20
- latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Setup your language (This is specific to each language)
# - name: Set up language ${{ matrix.language_version }}
# uses: actions/setup-python@v5
# with:
# language-version: ${{ matrix.language_version }}
- name: Set up Node.js ${{ matrix.node_version }}
uses: actions/[email protected]
with:
cache: npm
node-version: ${{ matrix.node_version }}

- name: Install dependencies
run: |
set -xe
echo "Installed dependencies"
# python -m pip install -r requirements.txt (for example)
- name: Build project
run: |
set -xe
echo "Building"
# Place your code to build your project here
npm i
- name: Testing
run: |
set -xe
echo "Testing project"
# Place your code to test your project here
npm run test
# It is recommended to require this check to pass before merging a pull request
check:
if: always()
name: Tests Successful
runs-on: ubuntu-latest
needs: [tests-os-matrix, tests]
needs: [tests]

steps:
- name: Whether the whole test suite passed
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
.eslintcache
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Ignore {{}} syntax in CITATION.cff
template/CITATION.cff
dist/*
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ A simple repository template to get started with GitHub.
Run the setup script to get started!

```sh
# Mark setup as executable
chmod +x ./setup.sh
./setup.sh
node ./setup.js
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>
Expand Down
Loading

0 comments on commit ed143fd

Please sign in to comment.