name: Automatic tests (DEV) permissions: read-all on: push: branches: [dev] jobs: # Containers build-containers: strategy: matrix: image: [bunkerweb, scheduler, autoconf, ui] include: - image: bunkerweb dockerfile: src/bw/Dockerfile - image: scheduler dockerfile: src/scheduler/Dockerfile - image: autoconf dockerfile: src/autoconf/Dockerfile - image: ui dockerfile: src/ui/Dockerfile uses: ./.github/workflows/container-build.yml with: RELEASE: dev ARCH: linux/amd64 IMAGE: ${{ matrix.image }} DOCKERFILE: ${{ matrix.dockerfile }} secrets: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} PRIVATE_REGISTRY: ${{ secrets.PRIVATE_REGISTRY }} PRIVATE_REGISTRY_TOKEN: ${{ secrets.PRIVATE_REGISTRY_TOKEN }} # Python code security code-security: runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: ["python"] steps: - name: Checkout repository uses: actions/checkout@v3 - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} config-file: ./.github/codeql.yml - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: category: "/language:${{matrix.language}}" # UI tests tests-ui: needs: [code-security, build-containers] uses: ./.github/workflows/tests-ui.yml with: RELEASE: dev secrets: PRIVATE_REGISTRY: ${{ secrets.PRIVATE_REGISTRY }} PRIVATE_REGISTRY_TOKEN: ${{ secrets.PRIVATE_REGISTRY_TOKEN }} # Core tests prepare-tests-core: needs: [code-security, build-containers] runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - id: set-matrix run: | tests=$(find ./tests/core/ -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | jq -c --raw-input --slurp 'split("\n")| .[0:-1]') echo "::set-output name=tests::$tests" outputs: tests: ${{ steps.set-matrix.outputs.tests }} tests-core: needs: prepare-tests-core strategy: fail-fast: false matrix: test: ${{ fromJson(needs.prepare-tests-core.outputs.tests) }} uses: ./.github/workflows/test-core.yml with: TEST: ${{ matrix.test }} RELEASE: dev secrets: PRIVATE_REGISTRY: ${{ secrets.PRIVATE_REGISTRY }} PRIVATE_REGISTRY_TOKEN: ${{ secrets.PRIVATE_REGISTRY_TOKEN }}