Skip to content

Commit 25efc09

Browse files
committed
chore: fix
1 parent 8a55772 commit 25efc09

File tree

1 file changed

+171
-171
lines changed

1 file changed

+171
-171
lines changed

.github/workflows/e2e.yml

Lines changed: 171 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -37,195 +37,195 @@ on:
3737
default: 3600
3838

3939
jobs:
40-
# executables:
41-
# if: ${{ inputs.test-executables }}
42-
# runs-on: ${{ matrix.os }}
43-
# container: ${{ matrix.container }}
44-
# strategy:
45-
# fail-fast: false
46-
# matrix:
47-
# include:
48-
# - os: ubuntu-latest
49-
# # container: ubuntu:18.04
50-
# executable: bright-cli-linux-x64
51-
# node: 18
52-
# - os: ubuntu-latest
53-
# # container: ubuntu:16.04
54-
# executable: bright-cli-linux-x64
55-
# node: 18
56-
# - os: ubuntu-latest
57-
# # container: fedora:24
58-
# executable: bright-cli-linux-x64
59-
# node: 18
60-
# - os: ubuntu-latest
61-
# # container: fedora:latest
62-
# executable: bright-cli-linux-x64
63-
# node: 20
64-
# - os: ubuntu-latest
65-
# executable: bright-cli-linux-x64
66-
# node: 20
67-
# - os: macos-11
68-
# executable: bright-cli-macos-x64
69-
# node: 20
70-
# - os: macos-latest
71-
# executable: bright-cli-macos-x64
72-
# node: 20
73-
# - os: windows-latest
74-
# executable: bright-cli-win-x64.exe
75-
# node: 20
76-
# - os: windows-2019
77-
# executable: bright-cli-win-x64.exe
78-
# node: 20
79-
# steps:
80-
# - name: Install Packages (Fedora)
81-
# if: ${{ startsWith(matrix.container, 'fedora') }}
82-
# run: |
83-
# dnf -y update \
84-
# && dnf install -y curl tar \
85-
# && dnf clean all \
86-
# && rm -rf /var/cache/dnf/*
40+
executables:
41+
if: ${{ inputs.test-executables }}
42+
runs-on: ${{ matrix.os }}
43+
container: ${{ matrix.container }}
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- os: ubuntu-latest
49+
# container: ubuntu:18.04
50+
executable: bright-cli-linux-x64
51+
node: 18
52+
- os: ubuntu-latest
53+
# container: ubuntu:16.04
54+
executable: bright-cli-linux-x64
55+
node: 18
56+
- os: ubuntu-latest
57+
# container: fedora:24
58+
executable: bright-cli-linux-x64
59+
node: 18
60+
- os: ubuntu-latest
61+
# container: fedora:latest
62+
executable: bright-cli-linux-x64
63+
node: 20
64+
- os: ubuntu-latest
65+
executable: bright-cli-linux-x64
66+
node: 20
67+
- os: macos-11
68+
executable: bright-cli-macos-x64
69+
node: 20
70+
- os: macos-latest
71+
executable: bright-cli-macos-x64
72+
node: 20
73+
- os: windows-latest
74+
executable: bright-cli-win-x64.exe
75+
node: 20
76+
- os: windows-2019
77+
executable: bright-cli-win-x64.exe
78+
node: 20
79+
steps:
80+
- name: Install Packages (Fedora)
81+
if: ${{ startsWith(matrix.container, 'fedora') }}
82+
run: |
83+
dnf -y update \
84+
&& dnf install -y curl tar \
85+
&& dnf clean all \
86+
&& rm -rf /var/cache/dnf/*
8787
88-
# - name: Install Packages (Ubuntu)
89-
# if: startsWith(matrix.container, 'ubuntu')
90-
# run: |
91-
# apt-get update -yq \
92-
# && apt-get install curl -yq \
93-
# && apt-get clean \
94-
# && rm -rf /var/lib/apt/lists/*
88+
- name: Install Packages (Ubuntu)
89+
if: startsWith(matrix.container, 'ubuntu')
90+
run: |
91+
apt-get update -yq \
92+
&& apt-get install curl -yq \
93+
&& apt-get clean \
94+
&& rm -rf /var/lib/apt/lists/*
9595
96-
# - name: Checkout Repository
97-
# uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5
98-
# env:
99-
# ACTIONS_ALLOW_UNSAFE_NODE_VERSION: true
100-
# ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16
101-
# ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
96+
- name: Checkout Repository
97+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5
98+
env:
99+
ACTIONS_ALLOW_UNSAFE_NODE_VERSION: true
100+
ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16
101+
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
102102

103-
# - name: Download Executable
104-
# shell: bash
105-
# run: |
106-
# curl -fsSL https://github.com/NeuraLegion/bright-cli/releases/download/${{ inputs.version }}/${{ matrix.executable }} > ./${{ matrix.executable }}
107-
# chmod +x ./${{ matrix.executable }}
103+
- name: Download Executable
104+
shell: bash
105+
run: |
106+
curl -fsSL https://github.com/NeuraLegion/bright-cli/releases/download/${{ inputs.version }}/${{ matrix.executable }} > ./${{ matrix.executable }}
107+
chmod +x ./${{ matrix.executable }}
108108
109-
# - name: Download Target
110-
# id: target
111-
# uses: ./.github/workflows/composite/todoapp
109+
- name: Download Target
110+
id: target
111+
uses: ./.github/workflows/composite/todoapp
112112

113-
# - name: Install Dependencies
114-
# uses: ./.github/workflows/composite/npm
115-
# with:
116-
# version: ${{ matrix.node }}
117-
# # https://github.com/actions/setup-node/issues/286#issuecomment-878865957
118-
# cache: ''
113+
- name: Install Dependencies
114+
uses: ./.github/workflows/composite/npm
115+
with:
116+
version: ${{ matrix.node }}
117+
# https://github.com/actions/setup-node/issues/286#issuecomment-878865957
118+
cache: ''
119119

120-
# - name: Run Tests
121-
# run: npm run test:e2e
122-
# env:
123-
# E2E_CLI_VERSION: ${{ inputs.version }}
124-
# E2E_CLI_CMD: ${{ runner.os != 'windows' && format('./{0}', matrix.executable) || format('.\{0}', matrix.executable) }}
125-
# E2E_RUN_ID: ${{ format('{0}-{1}-{2}-{3}', github.run_number, github.run_attempt, github.job, strategy.job-index) }}
126-
# E2E_CLUSTER: ${{ vars[format('E2E_{0}_HOST', inputs.environment )] }}
127-
# E2E_PROJECT_ID: ${{ vars[format('E2E_{0}_PROJECT_ID', inputs.environment )] }}
128-
# E2E_CLUSTER_API_KEY: ${{ secrets[format('E2E_{0}_API_KEY', inputs.environment )] }}
129-
# E2E_REPEATER_TARGET_URL: ${{ format('http://localhost:{0}', steps.target.outputs.port) }}
130-
# E2E_REPEATER_TARGET_CMD: ${{ steps.target.outputs.cmd }}
131-
# E2E_TEST_TIMEOUT: ${{ inputs.test_timeout }}
132-
# ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
133-
# ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16
134-
# ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
120+
- name: Run Tests
121+
run: npm run test:e2e
122+
env:
123+
E2E_CLI_VERSION: ${{ inputs.version }}
124+
E2E_CLI_CMD: ${{ runner.os != 'windows' && format('./{0}', matrix.executable) || format('.\{0}', matrix.executable) }}
125+
E2E_RUN_ID: ${{ format('{0}-{1}-{2}-{3}', github.run_number, github.run_attempt, github.job, strategy.job-index) }}
126+
E2E_CLUSTER: ${{ vars[format('E2E_{0}_HOST', inputs.environment )] }}
127+
E2E_PROJECT_ID: ${{ vars[format('E2E_{0}_PROJECT_ID', inputs.environment )] }}
128+
E2E_CLUSTER_API_KEY: ${{ secrets[format('E2E_{0}_API_KEY', inputs.environment )] }}
129+
E2E_REPEATER_TARGET_URL: ${{ format('http://localhost:{0}', steps.target.outputs.port) }}
130+
E2E_REPEATER_TARGET_CMD: ${{ steps.target.outputs.cmd }}
131+
E2E_TEST_TIMEOUT: ${{ inputs.test_timeout }}
132+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
133+
ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16
134+
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
135135

136-
# msi:
137-
# if: ${{ inputs.test-msi }}
138-
# runs-on: windows-latest
139-
# steps:
140-
# - name: Download and Install Bright CLI using MSI
141-
# shell: pwsh
142-
# run: |
143-
# Invoke-WebRequest -Uri https://github.com/NeuraLegion/bright-cli/releases/download/${{ inputs.version }}/bright-cli.msi -OutFile bright-cli.msi
144-
# $lastExitCode = (Start-Process msiexec.exe `
145-
# -ArgumentList "/i bright-cli.msi /qn /norestart /l*v `"$($pwd)\install.log`"" `
146-
# -PassThru `
147-
# -Wait `
148-
# -WorkingDirectory "$pwd").ExitCode
149-
# if ($lastExitCode -ne 0) {
150-
# Write-Error "Got exit code $lastExitCode."
151-
# Get-Content "$($pwd)\install.log"
152-
# exit 1
153-
# }
154-
# Write-Host "Bright CLI installation complete"
155-
# "C:\Program Files\BrightCLI" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
136+
msi:
137+
if: ${{ inputs.test-msi }}
138+
runs-on: windows-latest
139+
steps:
140+
- name: Download and Install Bright CLI using MSI
141+
shell: pwsh
142+
run: |
143+
Invoke-WebRequest -Uri https://github.com/NeuraLegion/bright-cli/releases/download/${{ inputs.version }}/bright-cli.msi -OutFile bright-cli.msi
144+
$lastExitCode = (Start-Process msiexec.exe `
145+
-ArgumentList "/i bright-cli.msi /qn /norestart /l*v `"$($pwd)\install.log`"" `
146+
-PassThru `
147+
-Wait `
148+
-WorkingDirectory "$pwd").ExitCode
149+
if ($lastExitCode -ne 0) {
150+
Write-Error "Got exit code $lastExitCode."
151+
Get-Content "$($pwd)\install.log"
152+
exit 1
153+
}
154+
Write-Host "Bright CLI installation complete"
155+
"C:\Program Files\BrightCLI" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
156156
157-
# - name: Get the version of Bright CLI after install
158-
# run: bright-cli.exe -v
159-
# shell: pwsh
157+
- name: Get the version of Bright CLI after install
158+
run: bright-cli.exe -v
159+
shell: pwsh
160160

161-
# - name: Checkout Repository
162-
# uses: actions/checkout@v2
161+
- name: Checkout Repository
162+
uses: actions/checkout@v2
163163

164-
# - name: Download Target
165-
# id: target
166-
# uses: ./.github/workflows/composite/todoapp
164+
- name: Download Target
165+
id: target
166+
uses: ./.github/workflows/composite/todoapp
167167

168-
# - name: Install Dependencies
169-
# uses: ./.github/workflows/composite/npm
170-
# with:
171-
# # https://github.com/actions/setup-node/issues/286#issuecomment-878865957
172-
# cache: ''
168+
- name: Install Dependencies
169+
uses: ./.github/workflows/composite/npm
170+
with:
171+
# https://github.com/actions/setup-node/issues/286#issuecomment-878865957
172+
cache: ''
173173

174-
# - name: Run Tests
175-
# run: npm run test:e2e
176-
# env:
177-
# E2E_CLI_VERSION: ${{ inputs.version }}
178-
# E2E_CLI_CMD: ${{ 'bright-cli.exe' }}
179-
# E2E_RUN_ID: ${{ format('{0}-{1}-{2}-{3}', github.run_number, github.run_attempt, github.job, strategy.job-index) }}
180-
# E2E_CLUSTER: ${{ vars[format('E2E_{0}_HOST', inputs.environment )] }}
181-
# E2E_PROJECT_ID: ${{ vars[format('E2E_{0}_PROJECT_ID', inputs.environment )] }}
182-
# E2E_CLUSTER_API_KEY: ${{ secrets[format('E2E_{0}_API_KEY', inputs.environment )] }}
183-
# E2E_REPEATER_TARGET_URL: ${{ format('http://localhost:{0}', steps.target.outputs.port) }}
184-
# E2E_REPEATER_TARGET_CMD: ${{ steps.target.outputs.cmd }}
185-
# E2E_TEST_TIMEOUT: ${{ inputs.test_timeout }}
174+
- name: Run Tests
175+
run: npm run test:e2e
176+
env:
177+
E2E_CLI_VERSION: ${{ inputs.version }}
178+
E2E_CLI_CMD: ${{ 'bright-cli.exe' }}
179+
E2E_RUN_ID: ${{ format('{0}-{1}-{2}-{3}', github.run_number, github.run_attempt, github.job, strategy.job-index) }}
180+
E2E_CLUSTER: ${{ vars[format('E2E_{0}_HOST', inputs.environment )] }}
181+
E2E_PROJECT_ID: ${{ vars[format('E2E_{0}_PROJECT_ID', inputs.environment )] }}
182+
E2E_CLUSTER_API_KEY: ${{ secrets[format('E2E_{0}_API_KEY', inputs.environment )] }}
183+
E2E_REPEATER_TARGET_URL: ${{ format('http://localhost:{0}', steps.target.outputs.port) }}
184+
E2E_REPEATER_TARGET_CMD: ${{ steps.target.outputs.cmd }}
185+
E2E_TEST_TIMEOUT: ${{ inputs.test_timeout }}
186186

187-
# docker:
188-
# if: ${{ inputs.test-docker }}
189-
# runs-on: ${{ matrix.os }}
190-
# strategy:
191-
# fail-fast: false
192-
# matrix:
193-
# # Windows can't run linux docker images: https://github.com/actions/runner-images/issues/1143
194-
# os: [ubuntu-latest, macos-latest]
195-
# steps:
196-
# - name: Install Docker (MacOS)
197-
# if: ${{ startsWith(matrix.os, 'macos') }}
198-
# uses: docker-practice/actions-setup-docker@master
199-
# timeout-minutes: 12
187+
docker:
188+
if: ${{ inputs.test-docker }}
189+
runs-on: ${{ matrix.os }}
190+
strategy:
191+
fail-fast: false
192+
matrix:
193+
# Windows can't run linux docker images: https://github.com/actions/runner-images/issues/1143
194+
os: [ubuntu-latest, macos-latest]
195+
steps:
196+
- name: Install Docker (MacOS)
197+
if: ${{ startsWith(matrix.os, 'macos') }}
198+
uses: docker-practice/actions-setup-docker@master
199+
timeout-minutes: 12
200200

201-
# - name: Pull Image
202-
# run: docker pull brightsec/cli:${{ inputs.version }}
201+
- name: Pull Image
202+
run: docker pull brightsec/cli:${{ inputs.version }}
203203

204-
# - name: Checkout Repository
205-
# uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5@v2
204+
- name: Checkout Repository
205+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5@v2
206206

207-
# - name: Download Target
208-
# id: target
209-
# uses: ./.github/workflows/composite/todoapp
207+
- name: Download Target
208+
id: target
209+
uses: ./.github/workflows/composite/todoapp
210210

211-
# - name: Install Dependencies
212-
# uses: ./.github/workflows/composite/npm
213-
# with:
214-
# # https://github.com/actions/setup-node/issues/286#issuecomment-878865957
215-
# cache: ''
211+
- name: Install Dependencies
212+
uses: ./.github/workflows/composite/npm
213+
with:
214+
# https://github.com/actions/setup-node/issues/286#issuecomment-878865957
215+
cache: ''
216216

217-
# - name: Run Tests
218-
# run: npm run test:e2e
219-
# env:
220-
# E2E_CLI_VERSION: ${{ inputs.version }}
221-
# E2E_CLI_CMD: docker run --add-host host.docker.internal:host-gateway --network host brightsec/cli:${{ inputs.version }}
222-
# E2E_RUN_ID: ${{ format('{0}-{1}-{2}-{3}', github.run_number, github.run_attempt, github.job, strategy.job-index) }}
223-
# E2E_CLUSTER: ${{ vars[format('E2E_{0}_HOST', inputs.environment )] }}
224-
# E2E_PROJECT_ID: ${{ vars[format('E2E_{0}_PROJECT_ID', inputs.environment )] }}
225-
# E2E_CLUSTER_API_KEY: ${{ secrets[format('E2E_{0}_API_KEY', inputs.environment )] }}
226-
# E2E_REPEATER_TARGET_URL: ${{ format('http://host.docker.internal:{0}', steps.target.outputs.port) }}
227-
# E2E_REPEATER_TARGET_CMD: ${{ steps.target.outputs.cmd }}
228-
# E2E_TEST_TIMEOUT: ${{ inputs.test_timeout }}
217+
- name: Run Tests
218+
run: npm run test:e2e
219+
env:
220+
E2E_CLI_VERSION: ${{ inputs.version }}
221+
E2E_CLI_CMD: docker run --add-host host.docker.internal:host-gateway --network host brightsec/cli:${{ inputs.version }}
222+
E2E_RUN_ID: ${{ format('{0}-{1}-{2}-{3}', github.run_number, github.run_attempt, github.job, strategy.job-index) }}
223+
E2E_CLUSTER: ${{ vars[format('E2E_{0}_HOST', inputs.environment )] }}
224+
E2E_PROJECT_ID: ${{ vars[format('E2E_{0}_PROJECT_ID', inputs.environment )] }}
225+
E2E_CLUSTER_API_KEY: ${{ secrets[format('E2E_{0}_API_KEY', inputs.environment )] }}
226+
E2E_REPEATER_TARGET_URL: ${{ format('http://host.docker.internal:{0}', steps.target.outputs.port) }}
227+
E2E_REPEATER_TARGET_CMD: ${{ steps.target.outputs.cmd }}
228+
E2E_TEST_TIMEOUT: ${{ inputs.test_timeout }}
229229

230230
npm:
231231
if: ${{ inputs.test-npm }}

0 commit comments

Comments
 (0)