46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
name: Deno Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
env:
|
|
DENO_DIR: my_cache_directory
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ ubuntu-20.04, macos-11, windows-2019 ]
|
|
steps:
|
|
- name: Setup repo
|
|
uses: actions/checkout@v2
|
|
- name: Cache Deno dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.DENO_DIR }}
|
|
key: my_cache_key
|
|
- name: Setup Deno
|
|
uses: denoland/setup-deno@v1
|
|
with:
|
|
deno-version: v1.x
|
|
# Check if the code is formatted according to Deno's default
|
|
# formatting conventions.
|
|
- run: deno fmt --check
|
|
|
|
# Scan the code for syntax errors and style issues. If
|
|
# you want to use a custom linter configuration you can add a configuration file with --config <myconfig>
|
|
- run: deno lint
|
|
|
|
|
|
# Run all test files in the repository and collect code coverage. The example
|
|
# runs with all permissions, but it is recommended to run with the minimal permissions your program needs (for example --allow-read).
|
|
- run: deno test --allow-all --coverage=cov/
|
|
|
|
# This generates a report from the collected coverage in `deno test --coverage`. It is
|
|
# stored as a .lcov file which integrates well with services such as Codecov, Coveralls and Travis CI.
|
|
- name: Generate coverage report
|
|
if: matrix.os == 'ubuntu-20.04'
|
|
run: deno coverage --lcov cov > cov.lcov
|