-
-
Notifications
You must be signed in to change notification settings - Fork 22
101 lines (97 loc) · 2.78 KB
/
build.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: build
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
permissions:
contents: read
issues: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: deno task test --coverage=.cov --junit-path=.test-report.xml
- uses: EnricoMi/publish-unit-test-result-action@v2
if: runner.os == 'Linux' && always()
with:
check_name: "Test Results (Linux)"
files: .test-report.xml
- uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: runner.os == 'macOS' && always()
with:
check_name: "Test Results (macOS)"
files: .test-report.xml
- uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: runner.os == 'Windows' && always()
with:
check_name: "Test Results (Windows)"
files: .test-report.xml
- run: deno coverage --lcov .cov > .cov.lcov
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: .cov.lcov
lint:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: deno task check
- run: deno task check
working-directory: ${{ github.workspace }}/examples/blog/
- run: deno task publish --dry-run
publish:
if: github.event_name == 'push'
needs: [test, lint]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- if: github.ref_type == 'branch'
run: |
jq \
--arg build "$GITHUB_RUN_NUMBER" \
--arg commit "${GITHUB_SHA::8}" \
'.version = .version + "-dev." + $build + "+" + $commit' \
deno.json > deno.json.tmp
mv deno.json.tmp deno.json
# Don't know why, but the .gitignore list is not overriden by include list
# in deno.json:
rm vocab/.gitignore
- if: github.ref_type == 'tag'
run: '[[ "$(jq .version deno.json)" = "$GITHUB_REF_NAME" ]]'
- run: deno task publish
publish-examples-blog:
needs: [test, lint]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: deno task codegen
- uses: denoland/deployctl@v1
with:
project: fedify-blog
entrypoint: ./examples/blog/main.ts
root: .