adding package-lock.json #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Build | |
on: | |
pull_request | |
jobs: | |
extract_metadata: | |
runs-on: ubuntu-latest | |
name: Extract supported_features | |
outputs: | |
supported-features: ${{ steps.supported-features.outputs.value }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: extract supported features | |
id: supported-features | |
run: echo "value=$(node -p -e "require('./px_metadata.json').supported_features?.join(' or ') || ''")" >> "$GITHUB_OUTPUT" | |
CI: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
needs: | |
- extract_metadata | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Build local cluster | |
run: ./ci_files/build_cluster.sh | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Sample-site Docker image | |
run: | | |
docker build -t localhost:5001/node-sample-site:1.0.0 . && docker images && docker push localhost:5001/node-sample-site:1.0.0 | |
env: | |
DOCKER_BUILDKIT: 1 | |
- name: install helm | |
run: | | |
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null | |
sudo apt-get install apt-transport-https --yes | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list | |
sudo apt-get update | |
sudo apt-get install helm=3.12.1-1 | |
- name: Clone helm charts repo - mock-collector | |
uses: actions/checkout@v2 | |
with: | |
repository: PerimeterX/connect-helm-charts | |
token: ${{ secrets.CONNECT_PULL_TOKEN }} | |
ref: mock-collector-0.1.0 | |
path: ./deploy_charts/mock-collector | |
- name: Clone helm charts repo - enforcer-tests | |
uses: actions/checkout@v2 | |
with: | |
repository: PerimeterX/connect-helm-charts | |
token: ${{ secrets.CONNECT_PULL_TOKEN }} | |
ref: enforcer-spec-tests-0.6.0 | |
path: ./deploy_charts/enforcer-spec-tests | |
- name: Clone helm charts repo - sample-site | |
uses: actions/checkout@v2 | |
with: | |
repository: PerimeterX/connect-helm-charts | |
token: ${{ secrets.CONNECT_PULL_TOKEN }} | |
ref: sample-site-0.1.0 | |
path: ./deploy_charts/sample-site | |
- name: deploy sample site | |
run: | | |
helm install sample-site ./deploy_charts/sample-site/charts/sample-site --set image.name=localhost:5001/node-sample-site --set image.tag=1.0.0 --set imagePullPolicy=Always --set collectorURL=http://mock-collector-mock-collector:3001 --wait | |
- name: Set up Google Cloud SDK | |
id: 'auth' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GCR_SA_KEY }}' | |
- name: Configure Docker credentials | |
run: | | |
gcloud auth configure-docker gcr.io | |
- name: pull mock collector image | |
run: | | |
docker pull gcr.io/px-docker-repo/connecteam/mock-collector:1.0.2 && \ | |
docker tag gcr.io/px-docker-repo/connecteam/mock-collector:1.0.2 localhost:5001/mock-collector:1.0.2 && \ | |
docker push localhost:5001/mock-collector:1.0.2 && \ | |
docker images | |
- name: deploy mock collector | |
run: | | |
helm install mock-collector ./deploy_charts/mock-collector/charts/mock-collector --set image.repository=localhost:5001/mock-collector --set image.tag=1.0.2 --set imagePullPolicy=Always --wait | |
- run: kubectl get pods | |
- name: pull enforcer tests image | |
run: | | |
docker pull gcr.io/px-docker-repo/connecteam/enforcer-specs-tests:1.1.0 && \ | |
docker tag gcr.io/px-docker-repo/connecteam/enforcer-specs-tests:1.1.0 localhost:5001/enforcer-spec-tests:1.1.0 && \ | |
docker push localhost:5001/enforcer-spec-tests:1.1.0 && \ | |
docker images | |
- name: run enforcer tests | |
run: | | |
helm install enforcer-spec-tests ./deploy_charts/enforcer-spec-tests/charts/enforcer-spec-tests --set image.repository=localhost:5001/enforcer-spec-tests --set image.tag=1.1.0 --set imagePullPolicy=Always \ | |
--set internalMockCollectorURL=http://mock-collector-mock-collector:3001 \ | |
--set appID=PXnEpdw6lS \ | |
--set siteURL=http://sample-site-sample-site:3000 \ | |
--set cookieSecret=${{ secrets.TEST_COOKIE_SECRET }} \ | |
--set supportedFeatures="${{ needs.extract_metadata.outputs.supported-features }}" \ | |
--set-file enforcerMetadataContent=./px_metadata.json | |
- name: wait until test is over | |
run: ./ci_files/wait-for-job.sh | |
env: | |
JOB_NAME: enforcer-spec-tests | |
- name: get tests results | |
if: ${{ always() }} | |
run: kubectl logs job/enforcer-spec-tests |