2023-04-29 15:21:30 +02:00
|
|
|
name: Automatic tests (STAGING)
|
|
|
|
|
|
|
|
permissions: read-all
|
2023-03-01 17:46:40 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [staging]
|
|
|
|
|
|
|
|
jobs:
|
2023-05-06 02:22:30 +02:00
|
|
|
# Build Docker images
|
|
|
|
build-containers:
|
2023-08-25 17:51:32 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
2023-05-06 02:22:30 +02:00
|
|
|
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
|
2023-04-29 16:50:57 +02:00
|
|
|
uses: ./.github/workflows/container-build.yml
|
|
|
|
with:
|
2023-08-15 11:40:05 +02:00
|
|
|
RELEASE: testing
|
2023-04-29 16:50:57 +02:00
|
|
|
ARCH: linux/amd64
|
2023-05-06 02:22:30 +02:00
|
|
|
CACHE: true
|
|
|
|
PUSH: true
|
|
|
|
IMAGE: ${{ matrix.image }}
|
|
|
|
DOCKERFILE: ${{ matrix.dockerfile }}
|
2023-04-29 16:50:57 +02:00
|
|
|
secrets:
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
2023-03-01 17:46:40 +01:00
|
|
|
|
2023-05-06 02:22:30 +02:00
|
|
|
# Build Linux packages
|
|
|
|
build-packages:
|
2023-08-25 17:51:32 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
2023-05-06 02:22:30 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
linux: [ubuntu, debian, fedora, rhel]
|
|
|
|
include:
|
|
|
|
- linux: ubuntu
|
|
|
|
package: deb
|
|
|
|
- linux: debian
|
|
|
|
package: deb
|
|
|
|
- linux: fedora
|
|
|
|
package: rpm
|
|
|
|
- linux: rhel
|
|
|
|
package: rpm
|
2023-04-29 21:43:26 +02:00
|
|
|
uses: ./.github/workflows/linux-build.yml
|
|
|
|
with:
|
2023-08-15 11:40:05 +02:00
|
|
|
RELEASE: testing
|
2023-05-06 02:22:30 +02:00
|
|
|
LINUX: ${{ matrix.linux }}
|
|
|
|
PACKAGE: ${{ matrix.package }}
|
|
|
|
TEST: true
|
|
|
|
PLATFORMS: linux/amd64
|
2023-04-29 21:43:26 +02:00
|
|
|
secrets:
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
2023-03-01 17:46:40 +01:00
|
|
|
|
2023-09-28 10:02:31 +02:00
|
|
|
codeql:
|
|
|
|
uses: ./.github/workflows/codeql.yml
|
2023-09-05 14:17:49 +02:00
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
2023-03-09 10:04:59 +01:00
|
|
|
|
2023-09-23 16:06:20 +02:00
|
|
|
# Create infrastructures and prepare tests
|
2023-09-05 14:17:49 +02:00
|
|
|
create-infras:
|
2023-09-28 10:02:31 +02:00
|
|
|
needs: [codeql, build-containers, build-packages]
|
2023-09-05 14:17:49 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
type: [docker, autoconf, swarm, k8s, linux]
|
|
|
|
uses: ./.github/workflows/staging-create-infra.yml
|
|
|
|
with:
|
|
|
|
TYPE: ${{ matrix.type }}
|
|
|
|
secrets:
|
|
|
|
CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
|
|
|
|
SECRET_KEY: ${{ secrets.SECRET_KEY }}
|
|
|
|
K8S_IP: ${{ secrets.K8S_IP }}
|
2023-09-23 16:06:20 +02:00
|
|
|
prepare-tests-core:
|
2023-09-28 10:02:31 +02:00
|
|
|
needs: [codeql, build-containers, build-packages]
|
2023-09-23 16:06:20 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-10-02 18:30:17 +02:00
|
|
|
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
|
2023-09-23 16:06:20 +02:00
|
|
|
- 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]')
|
2023-10-16 12:33:08 +02:00
|
|
|
echo "tests=$tests" >> $GITHUB_OUTPUT
|
2023-09-23 16:06:20 +02:00
|
|
|
outputs:
|
|
|
|
tests: ${{ steps.set-matrix.outputs.tests }}
|
2023-03-01 17:46:40 +01:00
|
|
|
|
2023-08-15 21:48:46 +02:00
|
|
|
# Perform tests
|
2023-09-23 16:06:20 +02:00
|
|
|
tests-ui:
|
2023-09-28 10:02:31 +02:00
|
|
|
needs: [codeql, build-containers]
|
2023-09-23 16:06:20 +02:00
|
|
|
uses: ./.github/workflows/tests-ui.yml
|
|
|
|
with:
|
|
|
|
RELEASE: testing
|
|
|
|
tests-ui-linux:
|
2023-09-28 10:02:31 +02:00
|
|
|
needs: [codeql, build-packages]
|
2023-09-23 16:06:20 +02:00
|
|
|
uses: ./.github/workflows/tests-ui-linux.yml
|
|
|
|
with:
|
|
|
|
RELEASE: testing
|
2023-09-05 14:17:49 +02:00
|
|
|
staging-tests:
|
|
|
|
needs: [create-infras]
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
type: [docker, autoconf, swarm, k8s, linux]
|
|
|
|
include:
|
|
|
|
- type: docker
|
|
|
|
runs_on: "['self-hosted', 'bw-docker']"
|
|
|
|
- type: autoconf
|
|
|
|
runs_on: "['self-hosted', 'bw-autoconf']"
|
|
|
|
- type: swarm
|
|
|
|
runs_on: "['self-hosted', 'bw-swarm']"
|
|
|
|
- type: k8s
|
|
|
|
runs_on: "['ubuntu-latest']"
|
|
|
|
- type: linux
|
|
|
|
runs_on: "['self-hosted', 'bw-linux']"
|
|
|
|
uses: ./.github/workflows/staging-tests.yml
|
|
|
|
with:
|
|
|
|
TYPE: ${{ matrix.type }}
|
|
|
|
RUNS_ON: ${{ matrix.runs_on }}
|
|
|
|
secrets: inherit
|
|
|
|
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: testing
|
2023-09-23 16:06:20 +02:00
|
|
|
tests-core-linux:
|
|
|
|
needs: prepare-tests-core
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
test: ${{ fromJson(needs.prepare-tests-core.outputs.tests) }}
|
|
|
|
uses: ./.github/workflows/test-core-linux.yml
|
|
|
|
with:
|
|
|
|
TEST: ${{ matrix.test }}
|
|
|
|
RELEASE: testing
|
|
|
|
secrets: inherit
|
2023-04-29 21:43:26 +02:00
|
|
|
|
2023-08-15 21:48:46 +02:00
|
|
|
# Delete infrastructures
|
2023-09-05 14:17:49 +02:00
|
|
|
delete-infras:
|
|
|
|
if: ${{ always() }}
|
|
|
|
needs: [staging-tests]
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
type: [docker, autoconf, swarm, k8s, linux]
|
|
|
|
uses: ./.github/workflows/staging-delete-infra.yml
|
|
|
|
with:
|
|
|
|
TYPE: ${{ matrix.type }}
|
|
|
|
secrets:
|
|
|
|
CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
|
|
|
|
SECRET_KEY: ${{ secrets.SECRET_KEY }}
|
2023-08-15 11:40:05 +02:00
|
|
|
|
|
|
|
# Push Docker images
|
|
|
|
push-images:
|
2023-09-05 14:17:49 +02:00
|
|
|
needs: [staging-tests, tests-ui, tests-core]
|
2023-08-15 11:40:05 +02:00
|
|
|
runs-on: ubuntu-latest
|
2023-08-25 17:51:32 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
2023-08-15 11:40:05 +02:00
|
|
|
steps:
|
|
|
|
- name: Login to Docker Hub
|
2023-10-02 18:30:17 +02:00
|
|
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
2023-08-15 11:40:05 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
2023-08-25 17:51:32 +02:00
|
|
|
- name: Login to ghcr
|
2023-10-02 18:30:17 +02:00
|
|
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
2023-08-15 11:40:05 +02:00
|
|
|
with:
|
2023-08-25 17:51:32 +02:00
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2023-08-15 11:40:05 +02:00
|
|
|
- name: Push BW image
|
2023-09-05 14:10:12 +02:00
|
|
|
run: docker pull ghcr.io/bunkerity/bunkerweb-tests:testing && docker tag ghcr.io/bunkerity/bunkerweb-tests:testing bunkerity/bunkerweb:testing && docker push bunkerity/bunkerweb:testing && docker tag bunkerity/bunkerweb:testing ghcr.io/bunkerity/bunkerweb:testing && docker push ghcr.io/bunkerity/bunkerweb:testing
|
2023-08-15 11:40:05 +02:00
|
|
|
- name: Push scheduler image
|
2023-09-05 14:10:12 +02:00
|
|
|
run: docker pull ghcr.io/bunkerity/scheduler-tests:testing && docker tag ghcr.io/bunkerity/scheduler-tests:testing bunkerity/bunkerweb-scheduler:testing && docker push bunkerity/bunkerweb-scheduler:testing && docker tag bunkerity/bunkerweb-scheduler:testing ghcr.io/bunkerity/bunkerweb-scheduler:testing && docker push ghcr.io/bunkerity/bunkerweb-scheduler:testing
|
2023-08-15 11:40:05 +02:00
|
|
|
- name: Push UI image
|
2023-09-05 14:10:12 +02:00
|
|
|
run: docker pull ghcr.io/bunkerity/ui-tests:testing && docker tag ghcr.io/bunkerity/ui-tests:testing bunkerity/bunkerweb-ui:testing && docker push bunkerity/bunkerweb-ui:testing && docker tag bunkerity/bunkerweb-ui:testing ghcr.io/bunkerity/bunkerweb-ui:testing && docker push ghcr.io/bunkerity/bunkerweb-ui:testing
|
2023-08-15 11:40:05 +02:00
|
|
|
- name: Push autoconf image
|
2023-09-05 14:10:12 +02:00
|
|
|
run: docker pull ghcr.io/bunkerity/autoconf-tests:testing && docker tag ghcr.io/bunkerity/autoconf-tests:testing bunkerity/bunkerweb-autoconf:testing && docker push bunkerity/bunkerweb-autoconf:testing && docker tag bunkerity/bunkerweb-autoconf:testing ghcr.io/bunkerity/bunkerweb-autoconf:testing && docker push ghcr.io/bunkerity/bunkerweb-autoconf:testing
|
2023-08-15 11:40:05 +02:00
|
|
|
|
|
|
|
# Push Linux packages
|
|
|
|
push-packages:
|
2023-09-23 16:06:20 +02:00
|
|
|
needs: [staging-tests, tests-ui-linux, tests-core-linux]
|
2023-08-15 11:40:05 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-09-05 14:10:12 +02:00
|
|
|
linux: [ubuntu, debian, fedora, el]
|
2023-08-15 12:47:38 +02:00
|
|
|
arch: [amd64]
|
2023-08-15 11:40:05 +02:00
|
|
|
include:
|
|
|
|
- release: testing
|
|
|
|
repo: bunkerweb
|
|
|
|
- linux: ubuntu
|
|
|
|
separator: _
|
|
|
|
suffix: ""
|
|
|
|
version: jammy
|
|
|
|
package: deb
|
|
|
|
- linux: debian
|
|
|
|
separator: _
|
|
|
|
suffix: ""
|
|
|
|
version: bullseye
|
|
|
|
package: deb
|
|
|
|
- linux: fedora
|
|
|
|
separator: "-"
|
|
|
|
suffix: "1."
|
|
|
|
version: 38
|
|
|
|
package: rpm
|
|
|
|
- linux: el
|
|
|
|
separator: "-"
|
|
|
|
suffix: "1."
|
|
|
|
version: 8
|
|
|
|
package: rpm
|
|
|
|
- linux: ubuntu
|
|
|
|
arch: amd64
|
|
|
|
package_arch: amd64
|
|
|
|
- linux: debian
|
|
|
|
arch: amd64
|
|
|
|
package_arch: amd64
|
|
|
|
- linux: fedora
|
|
|
|
arch: amd64
|
|
|
|
package_arch: x86_64
|
|
|
|
- linux: el
|
|
|
|
arch: amd64
|
|
|
|
package_arch: x86_64
|
|
|
|
uses: ./.github/workflows/push-packagecloud.yml
|
|
|
|
with:
|
|
|
|
SEPARATOR: ${{ matrix.separator }}
|
|
|
|
SUFFIX: ${{ matrix.suffix }}
|
|
|
|
REPO: ${{ matrix.repo }}
|
|
|
|
LINUX: ${{ matrix.linux }}
|
|
|
|
VERSION: ${{ matrix.version }}
|
|
|
|
PACKAGE: ${{ matrix.package }}
|
|
|
|
BW_VERSION: ${{ matrix.release }}
|
|
|
|
PACKAGE_ARCH: ${{ matrix.package_arch }}
|
|
|
|
ARCH: ${{ matrix.arch }}
|
|
|
|
secrets:
|
|
|
|
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
|
|
|
|
|
|
|
|
# Push doc
|
|
|
|
push-doc:
|
|
|
|
needs: [push-images, push-packages]
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
uses: ./.github/workflows/push-doc.yml
|
|
|
|
with:
|
|
|
|
VERSION: testing
|
|
|
|
ALIAS: unstable
|
|
|
|
secrets:
|
|
|
|
BUNKERBOT_TOKEN: ${{ secrets.BUNKERBOT_TOKEN }}
|
|
|
|
|
|
|
|
# Push on GH
|
|
|
|
push-gh:
|
|
|
|
needs: [push-doc]
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
discussions: write
|
|
|
|
uses: ./.github/workflows/push-github.yml
|
|
|
|
with:
|
|
|
|
VERSION: testing
|
2023-09-06 13:44:45 +02:00
|
|
|
PRERELEASE: true
|