-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (151 loc) · 5.6 KB
/
e2e.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
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
153
# This workflow requires artifacts to be created and available for download.
name: E2E Test
on:
workflow_call:
inputs:
smoke:
type: boolean
required: true
default: true
jobs:
e2e:
name: e2e-${{matrix.name}}
runs-on: ${{matrix.runs-on}}
env:
STRUCTURIZR_CLI_VERSION: v2024.07.03
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu
name: linux-x64
target: x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
- os: ubuntu
name: linux-arm64
target: aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
- os: macos
name: darwin-x64
target: x86_64-apple-darwin
runs-on: macos-latest
- os: macos
name: darwin-arm64
target: aarch64-apple-darwin
runs-on: macos-latest
- os: windows
name: win-x64
target: x86_64-ms-windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Mise Tools install
uses: jdx/mise-action@v2
if: ${{ matrix.os != 'windows' }}
with:
version: 2024.7.3
install: true
cache: true
experimental: true
- run: mise use [email protected]
if: ${{ matrix.os != 'windows' }}
- name: Choco Tools Install
run: |
choco install jq --version 1.7.1
choco install bun --version 1.1.20
if: ${{ matrix.os == 'windows' }}
- uses: actions/setup-java@v4
if: ${{ matrix.os == 'windows' }}
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'
- run: bun install --ignore-scripts
- name: Download version to test
uses: actions/download-artifact@v4
with:
name: TESTED_VERSION
- name: Download created artifacts
uses: actions/download-artifact@v4
with:
name: tarball-${{ matrix.target }}
- name: Extract tarball
if: ${{ matrix.os != 'windows' }}
run: |
mkdir -p ./dist
tar -xvf scfz-*.tar.gz -C ./dist/
mv ./dist/*/* ./dist/
- name: Extract tarball (Windows)
if: ${{ matrix.os == 'windows' }}
run: |
try {
New-Item -ItemType Directory -Force -Path ./dist
tar -xvf scfz-${{ matrix.name }}.tar.gz -C ./dist/
Move-Item -Path ./dist/*/* -Destination ./dist/
} catch {
Write-Error "An error occurred: $_"
}
- name: Cache Structurizr CLI
id: structurizr-cli-cache
uses: actions/cache@v4
with:
path: dist/structurizr-cli-bin
key: ${{ matrix.os }}-structurizr-cli-${{ env.STRUCTURIZR_CLI_VERSION }}
- name: Download Structurizr CLI
if: steps.structurizr-cli-cache.outputs.cache-hit != 'true' && matrix.os != 'windows'
run: |
mkdir -p dist/structurizr-cli-bin
wget https://github.com/structurizr/cli/releases/download/${{ env.STRUCTURIZR_CLI_VERSION }}/structurizr-cli.zip
unzip ./structurizr-cli.zip -d dist/structurizr-cli-bin/
ls -la dist/structurizr-cli-bin/
- name: Download Structurizr CLI (Windows)
if: steps.structurizr-cli-cache.outputs.cache-hit != 'true' && matrix.os == 'windows'
run: |
try {
New-Item -ItemType Directory -Force -Path dist/structurizr-cli-bin
Invoke-WebRequest -Uri "https://github.com/structurizr/cli/releases/download/${{ env.STRUCTURIZR_CLI_VERSION }}/structurizr-cli.zip" -OutFile structurizr-cli.zip
Expand-Archive -Path structurizr-cli.zip -DestinationPath dist/structurizr-cli-bin/
Get-ChildItem -Path dist/structurizr-cli-bin/
} catch {
Write-Error "An error occurred: $_"
}
- name: Extract version and add it to env variables
if: ${{ matrix.os != 'windows' }}
run: |
echo "TESTED_VERSION=$(cat ./TESTED_VERSION.txt)" >> ${GITHUB_ENV}
- name: Extract version and add it to env variables (Windows)
if: ${{ matrix.os == 'windows' }}
run: |
try {
$version = Get-Content -Path .\TESTED_VERSION.txt
echo "TESTED_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} catch {
Write-Error "An error occurred: $_"
}
- name: E2E Test (Smoke)
if: ${{ inputs.smoke && matrix.os != 'windows' }}
run: |
export STRUCTURIZR_CLI_PATH=./dist/structurizr-cli-bin/structurizr.sh
export TMP_FOLDER=${{ runner.temp }}
bun test:e2e:smoke
- name: E2E Test (Full)
if: ${{ !inputs.smoke && matrix.os != 'windows' }}
run: |
export STRUCTURIZR_CLI_PATH=./dist/structurizr-cli-bin/structurizr.sh
export TMP_FOLDER=${{ runner.temp }}
bun test:e2e
- name: E2E Test (Smoke) (Windows)
if: ${{ inputs.smoke && matrix.os == 'windows' }}
run: |
$env:STRUCTURIZR_CLI_PATH = ".\dist\structurizr-cli-bin\structurizr.bat"
$env:TMP_FOLDER = "${{ runner.temp }}"
$env:INPUT_TIMEOUT = "600"
java -version
bun test:e2e:smoke
- name: E2E Test (Full) (Windows)
if: ${{ !inputs.smoke && matrix.os == 'windows' }}
run: |
$env:STRUCTURIZR_CLI_PATH = ".\dist\structurizr-cli-bin\structurizr.bat"
$env:TMP_FOLDER = "${{ runner.temp }}"
$env:INPUT_TIMEOUT = "600"
java -version
bun test:e2e