-
Notifications
You must be signed in to change notification settings - Fork 138
140 lines (115 loc) · 3.42 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
name: "Checkin"
on:
push:
branches:
- main
pull_request:
jobs:
build-and-test:
name: "Build & Test"
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16', '17']
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup node"
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: "npm ci"
run: npm ci
- name: "Build"
run: npm run build
- name: "Linters"
run: npm run lint
- name: "Node Unit Tests"
run: npm run test-unit
- name: "Node Acceptance Tests"
run: npm run test-acceptance
# Disabled for the moment, I can't get sauce labs to work
# - name: "Browser Unit Tests"
# env:
# SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
# SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
# run: npm run test-browser
- name: "Coverage Push"
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: unit-${{ matrix.node }}
parallel: true
- name: "Artifacts"
uses: actions/upload-artifact@v2
with:
name: distribution
path: dist/*.js
ghpages:
name: "GH Pages"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup node"
uses: actions/setup-node@v2
with:
node-version: 17
- name: "npm ci"
run: npm ci
- name: "GH Pages Prepare"
run: npm run ghpages
- name: "GH Pages Push"
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_dir: docs
timezones:
name: "Timezones"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup node"
uses: actions/setup-node@v2
with:
node-version: 17
- name: "npm ci"
run: npm ci
- name: "Download tzdb"
id: tzdb
run: |
export TZDB_VERSION=$(node tools/scriptutils.js tzdb-version)
mkdir -p tools/tzdb
cd tools/tzdb
wget "https://data.iana.org/time-zones/releases/tzdata${TZDB_VERSION}.tar.gz" -O - | tar xz
- name: "Build vzic"
run: |
git clone https://github.com/libical/vzic tools/vzic
cd tools/vzic
make TZID_PREFIX="" OLSON_DIR="$(readlink -f ../tzdb)"
- name: "Run vzic"
run: tools/vzic/vzic --olson-dir tools/tzdb --output-dir tools/tzdb/zoneinfo
- name: "Create zones"
run: |
mkdir -p dist
node tools/scriptutils.js generate-zones tools/tzdb > dist/ical.timezones.js
- name: "Artifacts"
uses: actions/upload-artifact@v2
with:
name: timezones
path: dist/ical.timezones.js
finish:
needs: [build-and-test, timezones]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true