mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-28 05:36:34 +00:00
patch: setup virtual drive on linux
This commit is contained in:
parent
144590abc8
commit
801a3e1fa9
34
.github/actions/test/action.yml
vendored
34
.github/actions/test/action.yml
vendored
@ -106,6 +106,17 @@ runs:
|
|||||||
|
|
||||||
echo "TARGET_DRIVE=Microsoft Virtual Disk" | Out-File -FilePath $env:GITHUB_ENV -Append
|
echo "TARGET_DRIVE=Microsoft Virtual Disk" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||||
|
|
||||||
|
- name: Setup Virtual Drive on Linux
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y nbdkit nbd-client
|
||||||
|
sudo modprobe nbd
|
||||||
|
sudo nbdkit memory 4G
|
||||||
|
sudo nbd-client localhost /dev/nbd0
|
||||||
|
echo "TARGET_DRIVE=${/dev/nbd0}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Test release
|
- name: Test release
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -122,20 +133,15 @@ runs:
|
|||||||
# tests requires the app to already be built
|
# tests requires the app to already be built
|
||||||
npm run package
|
npm run package
|
||||||
|
|
||||||
if [[ '${{ runner.os }}' == 'Linux' ]]; then
|
# download the test source
|
||||||
# linux doesn't support e2e tests yet
|
wget -q -O ${{ env.TEST_SOURCE_FILE }} ${{ env.TEST_SOURCE_URL }}
|
||||||
npm run wdio:unit
|
# E2E tests can't input the administrative password, therefore the tests need to run as root
|
||||||
else
|
sudo \
|
||||||
# download the test source
|
TARGET_DRIVE=${{ env.TARGET_DRIVE }} \
|
||||||
wget -q -O ${{ env.TEST_SOURCE_FILE }} ${{ env.TEST_SOURCE_URL }}
|
ETCHER_INCLUDE_VIRTUAL_DRIVES=1 \
|
||||||
# E2E tests can't input the administrative password, therefore the tests need to run as root
|
TEST_SOURCE_FILE: $(pwd)/${{ env.TEST_SOURCE_FILE }} \
|
||||||
sudo \
|
TEST_SOURCE_URL: ${{ env.TEST_SOURCE_URL }} \
|
||||||
TARGET_DRIVE=${{ env.TARGET_DRIVE }} \
|
npm run wdio:ci
|
||||||
ETCHER_INCLUDE_VIRTUAL_DRIVES=1 \
|
|
||||||
TEST_SOURCE_FILE: $(pwd)/${{ env.TEST_SOURCE_FILE }} \
|
|
||||||
TEST_SOURCE_URL: ${{ env.TEST_SOURCE_URL }} \
|
|
||||||
npm run wdio:ci
|
|
||||||
fi
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# https://www.electronjs.org/docs/latest/api/environment-variables
|
# https://www.electronjs.org/docs/latest/api/environment-variables
|
||||||
|
Loading…
x
Reference in New Issue
Block a user