-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·67 lines (67 loc) · 2.1 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI
on: [push, pull_request]
jobs:
build:
name: test deno ${{ matrix.deno }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
deno: [v1.x, canary]
fail-fast: true
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup deno
uses: denoland/setup-deno@main
with:
deno-version: ${{ matrix.deno }}
- name: Check formatting
if: matrix.os == 'ubuntu-latest'
run: deno fmt --check
- name: Check linting
if: matrix.os == 'ubuntu-latest'
run: deno lint
- name: Run tests
run: deno test --coverage=cov
- name: Run tests unstable
run: deno test --unstable
- name: Generate lcov
if: |
matrix.os == 'ubuntu-latest' &&
matrix.deno == 'v1.x'
run: deno coverage --lcov cov > cov.lcov
- name: Upload coverage
if: |
matrix.os == 'ubuntu-latest' &&
matrix.deno == 'v1.x'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: cov.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Release info
if: |
github.repository == 'udibo/http-error' &&
matrix.os == 'ubuntu-latest' &&
matrix.deno == 'v1.x' &&
startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Bundle
if: env.RELEASE_VERSION != ''
run: |
mkdir -p target/release
deno bundle mod.ts target/release/http-error.${RELEASE_VERSION}.js
- name: Release
uses: softprops/action-gh-release@v1
if: env.RELEASE_VERSION != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
files: |
target/release/http-error.${{ env.RELEASE_VERSION }}.js