Delete .github/workflows/codeql-analysis.yml #5
This file contains hidden or 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: "CI/CD Pipeline" | |
on: | |
push: | |
branches-ignore: | |
- l10n_develop | |
- gh-pages | |
paths-ignore: | |
- '*.md' | |
- 'LICENSE' | |
- 'monitoring/grafana-dashboard.json' | |
- 'screenshots/**' | |
tags-ignore: | |
- '*' | |
pull_request: | |
paths-ignore: | |
- '*.md' | |
- 'LICENSE' | |
- 'data/static/i18n/*.json' | |
- 'frontend/src/assets/i18n/*.json' | |
env: | |
NODE_DEFAULT_VERSION: 20 | |
ANGULAR_CLI_VERSION: 17 | |
CYCLONEDX_NPM_VERSION: '^1.12.0' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out Git repository" | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 | |
- name: "Use Node.js 18" | |
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1 | |
with: | |
node-version: ${{ env.NODE_DEFAULT_VERSION }} | |
- name: "Install CLI tools" | |
run: npm install -g @angular/cli@$ANGULAR_CLI_VERSION | |
- name: "Install application minimalistically" | |
run: | | |
npm install --ignore-scripts | |
cd frontend | |
npm install --ignore-scripts --legacy-peer-deps | |
- name: "Lint source code" | |
run: npm run lint | |
- name: "Lint customization configs" | |
run: > | |
npm run lint:config -- -f ./config/7ms.yml && | |
npm run lint:config -- -f ./config/addo.yml && | |
npm run lint:config -- -f ./config/bodgeit.yml && | |
npm run lint:config -- -f ./config/ctf.yml && | |
npm run lint:config -- -f ./config/default.yml && | |
npm run lint:config -- -f ./config/fbctf.yml && | |
npm run lint:config -- -f ./config/juicebox.yml && | |
npm run lint:config -- -f ./config/mozilla.yml && | |
npm run lint:config -- -f ./config/oss.yml && | |
npm run lint:config -- -f ./config/quiet.yml && | |
npm run lint:config -- -f ./config/tutorial.yml && | |
npm run lint:config -- -f ./config/unsafe.yml | |
custom-config-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out Git repository" | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 | |
- name: "Use Node.js 18" | |
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1 | |
with: | |
node-version: ${{ env.NODE_DEFAULT_VERSION }} | |
- name: "Install CLI tools" | |
run: npm install -g @angular/cli@$ANGULAR_CLI_VERSION | |
- name: "Install application" | |
if: github.repository == 'juice-shop/juice-shop' || (github.repository != 'juice-shop/juice-shop' && matrix.os == 'ubuntu-latest' && matrix.node-version == '20') | |
run: npm install | |
- name: "Execute server tests for each custom configuration" | |
uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd #v2.8.3 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: > | |
NODE_ENV=7ms npm run test:server && | |
NODE_ENV=addo npm run test:server && | |
NODE_ENV=bodgeit npm run test:server && | |
NODE_ENV=ctf npm run test:server && | |
NODE_ENV=fbctf npm run test:server && | |
NODE_ENV=juicebox npm run test:server && | |
NODE_ENV=mozilla npm run test:server && | |
NODE_ENV=oss npm run test:server && | |
NODE_ENV=quiet npm run test:server && | |
NODE_ENV=tutorial npm run test:server && | |
NODE_ENV=unsafe npm run test:server | |
smoke-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out Git repository" | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 | |
- name: "Use Node.js 18" | |
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1 | |
with: | |
node-version: ${{ env.NODE_DEFAULT_VERSION }} | |
- name: "Install CLI tools" | |
run: | | |
npm install -g @angular/cli@$ANGULAR_CLI_VERSION | |
npm install -g @cyclonedx/cyclonedx-npm@$CYCLONEDX_NPM_VERSION | |
npm install -g grunt-cli | |
- name: "Set packaging options for Grunt" | |
run: | | |
echo "PCKG_OS_NAME=linux" >> $GITHUB_ENV | |
echo "PCKG_NODE_VERSION=18" >> $GITHUB_ENV | |
echo "PCKG_CPU_ARCH=x64" >> $GITHUB_ENV | |
- name: "Package application" | |
run: | | |
npm install --production | |
npm run package:ci | |
- name: "Unpack application archive" | |
run: | | |
cd dist | |
tar -zxf juice-shop-*.tgz | |
- name: "Execute smoke test" | |
run: | | |
cd dist/juice-shop_* | |
npm start & | |
cd ../.. | |
chmod +x test/smoke/smoke-test.sh | |
test/smoke/smoke-test.sh http://localhost:3000 | |
docker-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out Git repository" | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 | |
- name: "Execute smoke test on Docker" | |
run: docker compose -f docker-compose.test.yml up --exit-code-from sut | |
docker: | |
if: github.repository == 'juice-shop/juice-shop' && github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out Git repository" | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 | |
- name: "Set up QEMU" | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0 | |
- name: "Set up Docker Buildx" | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 #v3.0.0 | |
- name: "Login to DockerHub" | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d #v3.0.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: "Set tag & labels for ${{ github.ref }}" | |
run: | | |
if [ "$GITHUB_REF" == "refs/heads/master" ]; then | |
echo "DOCKER_TAG=latest" >> $GITHUB_ENV | |
else | |
echo "DOCKER_TAG=snapshot" >> $GITHUB_ENV | |
fi | |
echo "VCS_REF=`git rev-parse --short HEAD`" >> $GITHUB_ENV | |
echo "BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”`" >> $GITHUB_ENV | |
- name: "Build and push for AMD64 and ARM64 processors" | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 #v5.1.0 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
bkimminich/juice-shop:${{ env.DOCKER_TAG }} | |
build-args: | | |
VCS_REF=${{ env.VCS_REF }} | |
BUILD_DATE=${{ env.BUILD_DATE }} | |
CYCLONEDX_NPM_VERSION=${{ env.CYCLONEDX_NPM_VERSION }} |