Skip to content

Commit 98a47df

Browse files
committed
chore: test github actions
1 parent 5955a30 commit 98a47df

File tree

1 file changed

+66
-66
lines changed

1 file changed

+66
-66
lines changed

.github/workflows/ci.yml

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1+
name: Tests
2+
13
on:
24
push:
3-
branches:
4-
- master
5-
pull_request:
6-
branches:
7-
- master
8-
release:
9-
types:
10-
- created
11-
5+
branches: [ "*" ]
6+
127
jobs:
13-
build:
8+
test:
149
strategy:
1510
matrix:
1611
os: [macos-latest, ubuntu-latest, windows-latest]
1712
runs-on: ${{ matrix.os }}
18-
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
21-
- name: Run common build steps
22-
uses: ./.github/actions/common-build
23-
release-vsstudio-marketplace:
24-
runs-on: ubuntu-latest
25-
if: success() && startsWith( github.ref, 'refs/tags/')
26-
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
- name: Run common build steps
30-
uses: ./.github/actions/common-build
31-
- name: Publish Visual Studio Marketplace
32-
run: |
33-
if [ "${{ github.event_name }}" == "release" ] && [ "${{ github.event.release.prerelease }}" == "true" ]; then
34-
npm run deploy-vscode -- --pre-release
35-
else
36-
npm run deploy-vscode
37-
fi
38-
env:
39-
VSCE_PAT: ${{ secrets.VSCE_PAT }}
4013

41-
- name: Send Slack notification
42-
if: ${{ always() }}
43-
env:
44-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
45-
uses: 8398a7/action-slack@v3
46-
with:
47-
status: ${{ job.status }}
48-
text: "Tag: ${{ github.ref_name }} release to Visual Studio Marketplace status: ${{ job.status == 'success' && 'succeeded' || 'failed' }} :${{ job.status == 'success' && 'tada' || 'disappointed' }}:"
49-
50-
release-openvsx-marketplace:
51-
runs-on: ubuntu-latest
52-
if: success() && startsWith( github.ref, 'refs/tags/')
5314
steps:
54-
- name: Checkout
55-
uses: actions/checkout@v4
56-
- name: Run common build steps
57-
uses: ./.github/actions/common-build
58-
- name: Publish OpenVSX Marketplace
59-
run: |
60-
if [ "${{ github.event_name }}" == "release" ] && [ "${{ github.event.release.prerelease }}" == "true" ]; then
61-
npm run deploy-openvsx -- --pre-release
62-
else
63-
npm run deploy-openvsx
64-
fi
65-
env:
66-
OVSX_PAT: ${{ secrets.OVSX_PAT }}
15+
- uses: actions/checkout@v3
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
cache-dependency-path: |
23+
package-lock.json
24+
new_lineage_panel/package-lock.json
25+
webview_panels/package-lock.json
26+
27+
- name: Install dependencies
28+
run: |
29+
npm ci
30+
npm run install:panels
31+
32+
- name: Compile
33+
run: npm run compile
34+
35+
- name: Install xvfb
36+
if: runner.os == 'Linux'
37+
run: |
38+
sudo apt-get update
39+
sudo apt-get install -y xvfb
40+
41+
- name: Run tests (Linux)
42+
if: runner.os == 'Linux'
43+
run: |
44+
xvfb-run --auto-servernum npm run compile && xvfb-run --auto-servernum npm run test:coverage
45+
46+
- name: Run tests (macOS/Windows)
47+
if: runner.os != 'Linux'
48+
run: |
49+
npm run compile && npm run test:coverage
50+
51+
- name: Upload test results
52+
if: always()
53+
uses: actions/upload-artifact@v3
54+
with:
55+
name: test-results-${{ matrix.os }}
56+
path: test-results/
57+
58+
- name: Upload coverage results
59+
if: always()
60+
uses: actions/upload-artifact@v3
61+
with:
62+
name: coverage-${{ matrix.os }}
63+
path: |
64+
coverage/
65+
.nyc_output/
66+
*.lcov
6767
68-
- name: Send Slack notification
69-
if: ${{ always() }}
70-
env:
71-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
72-
uses: 8398a7/action-slack@v3
73-
with:
74-
status: ${{ job.status }}
75-
text: "Tag: ${{ github.ref_name }} release to openvsx marketplace status: ${{ job.status == 'success' && 'succeeded' || 'failed' }} :${{ job.status == 'success' && 'tada' || 'disappointed' }}:"
76-
68+
- name: Upload coverage to Codecov
69+
if: always()
70+
uses: codecov/codecov-action@v3
71+
with:
72+
token: ${{ secrets.CODECOV_TOKEN }}
73+
directory: ./coverage/
74+
flags: unittests
75+
name: codecov-${{ matrix.os }}
76+
fail_ci_if_error: false

0 commit comments

Comments
 (0)