-
Notifications
You must be signed in to change notification settings - Fork 15
95 lines (80 loc) · 2.29 KB
/
test-integration.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
name: Integration Tests
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths-ignore:
- "__tests__/**"
- ".github/**"
- "!.github/workflows/test-integration.ya?ml"
- "**.md"
- ".gitignore"
- "LICENSE"
pull_request:
paths-ignore:
- "__tests__/**"
- ".github/**"
- "!.github/workflows/test-integration.ya?ml"
- "**.md"
- ".gitignore"
- "LICENSE"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by external changes.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:
jobs:
defaults:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run action with defaults
uses: ./ # Use the action from the local path.
- name: Run Task
# Verify that Task was installed
run: task --version
version:
name: version (${{ matrix.version.input }}, ${{ matrix.runs-on }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on:
- ubuntu-latest
- windows-latest
- macos-latest
version:
- input: 2.x
expected: "Task version: 2.8.1"
- input: 2.8.x
expected: "Task version: 2.8.1"
- input: 3.4.1
expected: "Task version: 3.4.1"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run action, using Task minor version wildcard
uses: ./
with:
version: ${{ matrix.version.input }}
repo-token: ${{ github.token }}
- name: Check Task version
shell: bash
run: |
[[ "$(task --version)" == "${{ matrix.version.expected }}" ]]
invalid-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run action, using invalid version
id: setup-task
continue-on-error: true
uses: ./
with:
version: 2.42.x
- name: Fail the job if the action run succeeded
if: steps.setup-task.outcome == 'success'
run: |
echo "::error::The action run was expected to fail, but passed!"
exit 1