Add NestJS plugin #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
deno: [v1.x] | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macOS-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Set up Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: ${{ matrix.deno }} | |
- name: Run checks | |
run: deno task check | |
- name: Run tests | |
run: deno task test | |
env: | |
IGNORE_DOCKER_TESTS: ${{ matrix.os == 'ubuntu-latest' && 'false' || 'true' }} | |
- name: Run examples tests | |
if: matrix.os == 'ubuntu-latest' | |
run: deno task test:examples | |
# TODO: add when this is relevant | |
# - name: Type check browser compatible modules | |
# shell: bash | |
# run: deno task test:browser | |
- name: Generate lcov | |
shell: bash | |
# excludes tests, testdata, and generated sources from coverage report | |
run: | | |
deno coverage ./cov/ --lcov --exclude="test\\.(ts|js)|wasm\\.js|testdata" > cov.lcov | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
name: ${{ matrix.os }}-${{ matrix.deno }} | |
files: cov.lcov | |
- name: Remove coverage report | |
shell: bash | |
run: | | |
rm -rf ./cov/ | |
rm cov.lcov | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Set up Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: vx.x.x | |
- name: Format | |
run: deno fmt --check | |
- name: Lint | |
run: deno lint | |
- name: Check License headers | |
run: deno task fmt:licence-headers --check | |
- name: Check Deprecations | |
run: "deno task lint:deprecations" | |
- name: Check Import paths in Docs | |
run: "deno task lint:doc-imports" | |
- name: Check non-test assertions | |
run: deno task lint:check-assertions | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Set up Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Build npm | |
run: deno task build | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: npm | |
retention-days: 1 | |
release: | |
runs-on: ubuntu-latest | |
needs: [test, lint, build] | |
if: | | |
github.repository == 'jonnydgreen/nifty-lil-tricks-testing' && | |
github.ref == 'refs/heads/main' | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Download build artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: build | |
path: npm | |
- name: Set up Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Create app token | |
uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ secrets.JONNYDGREEN_BOT_APP_ID }} | |
private-key: ${{ secrets.JONNYDGREEN_BOT_PRIVATE_KEY }} | |
- name: Release if version change | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: ./_tools/release.ts |