-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (84 loc) · 2.77 KB
/
test.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
name: Test
run-name: |
${{ (github.event_name == 'pull_request' && format('Test (PR #{0}): {1}', github.event.number, github.event.pull_request.title))
|| format('Test: {0}', github.event.head_commit.message) }}
on:
# Event: A maintainer has pushed commits or merged a PR to main.
push:
# Limiting push events to 'main' prevents duplicate runs of this workflow
# when maintainers push to internal PRs.
branches:
- main
# Event: A contributor has created or updated a PR.
pull_request:
types: [opened, synchronize, reopened, labeled]
branches:
- main
jobs:
bundles:
name: Check Bundles
runs-on: ubuntu-latest
steps:
- name: Diagnostics
shell: bash
run: |
cat <<GITHUB_EVENT_JSON
${{toJSON(github.event)}}
GITHUB_EVENT_JSON
- 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: Setup Neon Environment
id: neon
uses: ./.github/actions/setup-neon
with:
platform: linux-x64-gnu
workspace: ./pkgs/cargo-messages
- name: Install Dependencies
shell: bash
run: npm ci --verbose
- name: Build
shell: bash
env:
CARGO_BUILD_TARGET: ${{ steps.neon.outputs.target }}
NEON_BUILD_PLATFORM: linux-x64-gnu
run: npm run build
working-directory: ./pkgs/cargo-messages
- name: Pack
shell: bash
run: npm pack ./platforms/linux-x64-gnu --pack-destination=${{ runner.temp }}
working-directory: ./pkgs/cargo-messages
- name: Start npm Proxy
shell: bash
working-directory: ./test/integration/proxy
timeout-minutes: 3
run: ./ci-proxy.sh
- name: Publish to npm Proxy
shell: bash
working-directory: ./test/integration/proxy
timeout-minutes: 3
run: ./publish.sh linux-x64-gnu
# 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`.
- name: Setup test-sniff-bytes Integration Test
shell: bash
working-directory: test/integration/test-sniff-bytes
run: npm i || (cat ../proxy/proxy.log && exit 1)
- name: Run test-sniff-bytes Integration Test
shell: bash
working-directory: test/integration/test-sniff-bytes
run: npm test