-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (148 loc) · 5.46 KB
/
tests.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Tests
on:
push:
branches: [ main ]
paths:
- 'dist/*.js'
- '.github/workflows/tests.yml'
pull_request:
branches: [ main ]
jobs:
test-release:
name: Test Release Installation
strategy:
matrix:
swift-version: [ '5.7', '5.8.1' ]
os-version: [ 'ubuntu-22.04' ]
include:
- swift-version: '5.6'
os-version: ubuntu-20.04
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v4
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/swifty-linux-action@main
if: ${{ github.event_name == 'push' }}
id: install-swift-main
with:
release-version: ${{ matrix.swift-version }}
platform: ${{ matrix.os-version }}
github-token: ${{ github.token }}
- uses: './'
if: ${{ github.event_name == 'pull_request' }}
id: install-swift-local
with:
release-version: ${{ matrix.swift-version }}
platform: ${{ matrix.os-version }}
github-token: ${{ github.token }}
- id: install-swift
env:
EVENT_NAME: ${{ github.event_name }}
BRANCH_INSTALL_PATH: ${{ steps.install-swift-main.outputs.install-path }}
LOCAL_INSTALL_PATH: ${{ steps.install-swift-local.outputs.install-path }}
run: |
if [ "${EVENT_NAME}" == 'push' ]; then
echo "install-path=${BRANCH_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
else
echo "install-path=${LOCAL_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
fi
- name: Check installed path
env:
INSTALL_PATH: ${{ steps.install-swift.outputs.install-path }}
run: test -d "${INSTALL_PATH}"
- name: Check installed version
env:
EXPECTED_VERSION: ${{ matrix.swift-version }}
run: swift --version | grep -q "${EXPECTED_VERSION}"
test-branch:
name: Test Branch Installation
strategy:
matrix:
swift-version: [ '5.7', '5.8.1' ]
os-version: [ 'ubuntu-22.04' ]
include:
- swift-version: '5.6'
os-version: ubuntu-20.04
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v4
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/swifty-linux-action@main
if: ${{ github.event_name == 'push' }}
id: install-swift-main
with:
branch-name: swift-${{ matrix.swift-version }}-release
version-tag: swift-${{ matrix.swift-version }}-RELEASE
platform: ${{ matrix.os-version }}
- uses: './'
if: ${{ github.event_name == 'pull_request' }}
id: install-swift-local
with:
branch-name: swift-${{ matrix.swift-version }}-release
version-tag: swift-${{ matrix.swift-version }}-RELEASE
platform: ${{ matrix.os-version }}
- id: install-swift
env:
EVENT_NAME: ${{ github.event_name }}
BRANCH_INSTALL_PATH: ${{ steps.install-swift-main.outputs.install-path }}
LOCAL_INSTALL_PATH: ${{ steps.install-swift-local.outputs.install-path }}
run: |
if [ "${EVENT_NAME}" == 'push' ]; then
echo "install-path=${BRANCH_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
else
echo "install-path=${LOCAL_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
fi
- name: Check installed path
env:
INSTALL_PATH: ${{ steps.install-swift.outputs.install-path }}
run: test -d "${INSTALL_PATH}"
- name: Check installed version
env:
EXPECTED_VERSION: ${{ matrix.swift-version }}
run: swift --version | grep -q "${EXPECTED_VERSION}"
test-release-noplatform:
name: Test Release Installation w/o Platform
strategy:
matrix:
os-version: [ 'ubuntu-22.04', 'ubuntu-20.04' ]
env:
INPUT_SWIFT_VERSION: '5.8'
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v4
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/swifty-linux-action@main
if: ${{ github.event_name == 'push' }}
id: install-swift-main
with:
release-version: ${{ env.INPUT_SWIFT_VERSION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: './'
if: github.event_name == 'pull_request'
id: install-swift-local
with:
release-version: ${{ env.INPUT_SWIFT_VERSION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- id: install-swift
env:
EVENT_NAME: ${{ github.event_name }}
BRANCH_INSTALL_PATH: ${{ steps.install-swift-main.outputs.install-path }}
LOCAL_INSTALL_PATH: ${{ steps.install-swift-local.outputs.install-path }}
run: |
if [ "${EVENT_NAME}" == 'push' ]; then
echo "install-path=${BRANCH_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
else
echo "install-path=${LOCAL_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
fi
- name: Check installed path
env:
INSTALL_PATH: ${{ steps.install-swift.outputs.install-path }}
run: test -d "${INSTALL_PATH}"
- name: Check installed version
run: swift --version | grep -q "${INPUT_SWIFT_VERSION}"