Create CI workflow and tests

This commit is contained in:
Nick Alteen
2023-08-23 13:39:12 -04:00
parent 3cfb7ea35a
commit 464b2658f0
8 changed files with 513 additions and 111 deletions

60
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,60 @@
name: Continuous Integration
on:
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
test-typescript:
name: TypeScript Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v3
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v3
with:
node-version-file: .node-version
cache: npm
- name: Install Dependencies
id: npm-ci
run: npm ci
- name: Check Format
id: npm-format-check
run: npm run format:check
- name: Lint
id: npm-lint
run: npm run lint
- name: Test
id: npm-ci-test
run: npm ci-test
test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v3
- name: Test Local Action
id: test-action
uses: ./
with:
milliseconds: 1000
- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"

View File

@ -1,24 +0,0 @@
name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
npm install
- run: |
npm run all
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
milliseconds: 1000