forked from bids-standard/legacy-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (93 loc) · 2.84 KB
/
deno_tests.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
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
---
name: Deno build
on:
push:
branches: [master]
tags: ['*']
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Save describe stamp
id: describe
run: echo version=$( git describe ) >> $GITHUB_OUTPUT
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: ./build.ts
working-directory: ./bids-validator
- run: deno run -A ./bids-validator/dist/validator/bids-validator.js --version
- uses: actions/upload-artifact@v4
with:
name: main
path: bids-validator/dist/validator
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-22.04, macos-12, windows-2022]
allow-net: [true, false]
fail-fast: false
defaults:
run:
working-directory: ./bids-validator
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Set permissions with network access
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --allow-net' >> $GITHUB_ENV
if: ${{ matrix.allow-net }}
- name: Set permissions without network access
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --deny-net' >> $GITHUB_ENV
if: ${{ ! matrix.allow-net }}
- run: deno test $PERMS --coverage=cov/ src/
- name: Collect coverage
run: deno coverage cov/ --lcov --output=coverage.lcov
if: ${{ always() }}
- uses: codecov/codecov-action@v4
if: ${{ always() }}
with:
files: coverage.lcov
deploy:
needs: [build]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' && github.repository_owner == 'bids-standard'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_TOKEN }}
- name: Set credentials
run: |
git config --global user.name "BIDS-Bot"
git config --global user.email "[email protected]"
- name: Reset deno-build to orphan
run: |
git checkout --orphan deno-build
git reset --hard
- uses: actions/download-artifact@v4
with:
name: main
path: main
- name: Commit to new branch
run: |
mv main/main.js main/bids-validator.js .
git add main.js bids-validator.js
git commit -m "BLD: $VERSION [skip ci]" || true
env:
VERSION: ${{ needs.build.describe.version }}
- name: Push
run: git push -f origin deno-build