-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (115 loc) · 4.34 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
name: CI
env:
NODE_VERSION: 18.x
PROXY: http://127.0.0.1:4873/
CIUSER: ci
CIEMAIL: [email protected]
CIPASS: dummycipassword
on:
push:
# Prevent duplicate runs of this workflow on our own internal PRs.
branches:
- main
- next/*
pull_request:
types: [opened, synchronize, reopened, labeled]
branches:
- main
- next/*
jobs:
bundles:
name: Check Bundles
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check Bundles
shell: bash
run: ./test/lint/check-bundles.sh
integration:
name: Integration Tests
needs: [bundles]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dependencies
shell: bash
run: npm ci --verbose
- name: Build
uses: neon-actions/[email protected]
with:
working-directory: ./pkgs/cargo-messages
target: linux-x64-gnu
node-version: ${{ env.NODE_VERSION }}
use-cross: false
npm-publish: false
github-release: false
- name: Start npm Proxy
shell: bash
working-directory: ./test/integration/proxy
timeout-minutes: 3
run: ./proxy.sh '${{ env.PROXY }}'
- name: Authenticate Proxy
shell: bash
run: npx npm-cli-adduser -u ${{env.CIUSER}} -p ${{env.CIPASS}} -e ${{env.CIEMAIL}} -r ${{env.PROXY}}
- name: Publish @cargo-messages/linux-x64-gnu to proxy
shell: bash
run: npm publish ./pkgs/cargo-messages/dist/"cargo-messages-linux-x64-gnu-$(jq -r '.version' < ./pkgs/cargo-messages/package.json).tgz" --registry ${{env.PROXY}}
- name: Publish cargo-messages to proxy
shell: bash
working-directory: ./pkgs/cargo-messages
run: npm publish --registry ${{env.PROXY}}
- name: Publish @neon-rs/load to proxy
shell: bash
working-directory: ./pkgs/load
run: npm publish --registry ${{env.PROXY}}
- name: Publish @neon-rs/cli to proxy
shell: bash
working-directory: ./pkgs/cli
run: npm publish --registry ${{env.PROXY}}
- name: Install Dependencies for sniff-bytes Integration Test
shell: bash
working-directory: ./test/integration/sniff-bytes
run: |
npm ci
cat package-lock.json
- name: Build sniff-bytes Integration Test
uses: neon-actions/[email protected]
with:
working-directory: ./test/integration/sniff-bytes
target: linux-x64-gnu
node-version: ${{ env.NODE_VERSION }}
use-cross: false
npm-publish: false
github-release: false
- name: Display the integrity shasum of @sniff-bytes/linux-x64-gnu
shell: bash
run: cat ./test/integration/sniff-bytes/dist/sniff-bytes-linux-x64-gnu-1.0.0.tgz | shasum -a 512
- name: Publish @sniff-bytes/linux-x64-gnu to proxy
shell: bash
run: npm publish ./test/integration/sniff-bytes/dist/sniff-bytes-linux-x64-gnu-1.0.0.tgz --registry ${{ env.PROXY }} || (cat test/integration/proxy/proxy.log && exit 1)
- name: Display the integrity shasum of @sniff-bytes/linux-x64-gnu
shell: bash
run: |
cat ./test/integration/sniff-bytes/dist/sniff-bytes-linux-x64-gnu-1.0.0.tgz | shasum -a 512
npm view cargo-messages dist.integrity --registry ${{env.PROXY}}
npm view @sniff-bytes/linux-x64-gnu dist.integrity --registry ${{env.PROXY}}
# curl -s ${{env.PROXY}}/@sniff-bytes/linux-x64-gnu | jq -r '.versions[.["dist-tags"].latest].dist.integrity'
- name: Publish sniff-bytes to proxy
shell: bash
working-directory: test/integration/sniff-bytes
run: npm publish --registry ${{ env.PROXY }}
- name: Run test-sniff-bytes tests
shell: bash
working-directory: test/integration/test-sniff-bytes
run: |
# Since package integrity checksums may vary depending on what versions
# are available in the proxy registry, we don't put the lockfile for this
# test in source control. This means we have to use `npm i`, not `npm ci`.
npm i --registry ${{ env.PROXY }} || (cat test/integration/proxy/proxy.log && exit 1)
npm test