-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.63 KB
/
test.yaml
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
name: build & test
on:
pull_request:
paths-ignore:
- "*.md"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Run test on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install packages
run: npm ci
- name: Run tests
run: npm run test
- name: Build package
run: npm run build
- name: Test installing gh cli
id: install
uses: ./
with:
version: 2.34.0
- name: Test gh command works on ubuntu
if: matrix.os == 'ubuntu-latest'
env:
INSTALL_OUTPUT: ${{ steps.install.outputs.gh_version }}
run: |
echo "Installed gh version: $INSTALL_OUTPUT"
$RUNNER_TOOL_CACHE/gh/2.34.0/x64/bin/gh --version
- name: Test gh command works on macos
if: matrix.os == 'macos-latest'
env:
INSTALL_OUTPUT: ${{ steps.install.outputs.gh_version }}
run: |
echo "Installed gh version: $INSTALL_OUTPUT"
ls -R $RUNNER_TOOL_CACHE/gh
$RUNNER_TOOL_CACHE/gh/2.34.0/x64/gh_2.34.0_macOS_amd64/bin/gh --version
- name: Test gh command works on windows
if: matrix.os == 'windows-latest'
shell: cmd
env:
INSTALL_OUTPUT: ${{ steps.install.outputs.gh_version }}
run: |
echo "Installed gh version: %INSTALL_OUTPUT%"
%RUNNER_TOOL_CACHE%\gh\2.34.0\x64\bin\gh --version