-
Notifications
You must be signed in to change notification settings - Fork 60
87 lines (78 loc) · 2.56 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
name: CI
on:
push:
branches: [main]
tags: ["releases/**"]
pull_request:
branches: ["*"]
jobs:
typescript:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: [ws-protocol, ws-protocol-examples]
node-version: [16.x, 18.x]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: yarn
- name: Ensure examples use current version of ws-protocol package
run: "! grep '@foxglove/ws-protocol' yarn.lock"
- run: yarn install --frozen-lockfile
- run: yarn workspace @foxglove/${{ matrix.package }} lint:ci
- run: yarn workspace @foxglove/${{ matrix.package }} test
- name: Publish to NPM
if: ${{ startsWith(github.ref, format('refs/tags/releases/typescript/{0}/v', matrix.package)) }}
run: yarn workspace @foxglove/${{ matrix.package }} publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pipenv
- run: pip install pipenv>=2022.1.8
- run: pipenv install --dev --deploy
- run: pipenv run black --check .
- run: pipenv run pyright src tests
- run: pipenv run pytest
- run: pipenv run python -m build
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
with:
user: __token__
password: ${{ secrets.TESTPYPI_API_TOKEN }}
packages_dir: python/dist
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/releases/python/v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: python/dist
cpp:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
make_cmd: [format-check, build, build-cpp20, build-boost-asio]
defaults:
run:
working-directory: cpp
name: cpp (${{ matrix.make_cmd }})
steps:
- uses: actions/checkout@v3
- run: make ${{ matrix.make_cmd }}