Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smoke test variant for Docker macos bundle #1592

Merged
merged 1 commit into from
Jan 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
snyk_cli_dl_file: snyk-alpine
- snyk_install_method: npm-root-user
os: ubuntu
- snyk_install_method: docker-bundle
os: macos
snyk_cli_dl_file: docker-mac-signed-bundle.tar.gz

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -87,6 +90,21 @@ jobs:
docker build -t snyk-cli-alpine -f ./test/smoke/alpine/Dockerfile ./test
docker run -eCI=1 -eSMOKE_TESTS_SNYK_TOKEN snyk-cli-alpine

- name: Install snyk from Docker bundle
if: ${{ matrix.snyk_install_method == 'docker-bundle' }}
run: |
snyk_cli_dl=$(curl https://api.github.com/repos/snyk/snyk/releases/latest | jq --raw-output '(.assets[])? | select(.name == "${{ matrix.snyk_cli_dl_file }}") | .browser_download_url')
echo "snyk_cli_dl: ${snyk_cli_dl}"
curl -Lo ./snyk-cli.tar.gz $snyk_cli_dl
sudo mkdir -p /usr/local/bin/snyk-mac
sudo mv ./snyk-cli.tar.gz /usr/local/bin/snyk-mac
sudo tar -xf /usr/local/bin/snyk-mac/snyk-cli.tar.gz -C /usr/local/bin/snyk-mac # makes a folder called docker
sudo ln -s /usr/local/bin/snyk-mac/docker/snyk-mac.sh /usr/local/bin/snyk-mac/docker/snyk
ls -la /usr/local/bin/snyk-mac/docker
export PATH="/usr/local/bin/snyk-mac/docker:$PATH"
which snyk
snyk version

- name: Run npm test with Root user
if: ${{ matrix.snyk_install_method == 'npm-root-user' }}
env:
Expand Down Expand Up @@ -165,6 +183,9 @@ jobs:
env:
SMOKE_TESTS_SNYK_TOKEN: ${{ secrets.SMOKE_TESTS_SNYK_TOKEN }}
run: |
export PATH="/usr/local/bin/snyk-mac/docker:$PATH"
which snyk
snyk version
export EXPECTED_SNYK_VERSION=$(snyk --version)
shellspec -f d

Expand Down