From 3fdc2c41d683ef6f44342ccff4b2b2065add1ac4 Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Mon, 22 Jul 2024 17:22:23 +0000 Subject: [PATCH] [ci] Unified github action files #303 - Updated dependabot configuration Fixes #303 --- .github/dependabot.yml | 18 +++++- .github/workflows/branch.yml | 62 --------------------- .github/workflows/ci.yml | 89 ++++++++++++++++++++++++++++++ .github/workflows/pull_request.yml | 40 -------------- 4 files changed, 104 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/branch.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/pull_request.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index db958279..9a4ece39 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,9 +5,21 @@ version: 2 updates: - - package-ecosystem: "pip" # See documentation for possible values - directory: "/" # Location of package manifests + - package-ecosystem: "pip" + directories: + - "**/*" schedule: - interval: "monthly" + interval: "weekly" commit-message: prefix: "[deps] " + - package-ecosystem: "docker" + directories: + - "**/*" + schedule: + interval: "weekly" + commit-message: + prefix: "[deps] " + + + + diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml deleted file mode 100644 index c4a99c25..00000000 --- a/.github/workflows/branch.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: Automation Tests - -on: - push: - branches: - - master - -jobs: - build: - name: CD Build - runs-on: ubuntu-22.04 - steps: - - name: Git Checkout - uses: actions/checkout@v2 - - - name: Install Testing Requirements - run: | - sudo pip install -U pip setuptools wheel - sudo pip install -r requirements-test.txt - - - name: Install Testing Requirements - run: | - sudo pip install -r requirements-test.txt - sudo curl -sL -o /bin/hadolint "https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64" - sudo chmod +x /bin/hadolint - - - name: QA checks - run: ./run-qa-checks - - - name: Setup - run: | - echo "127.0.0.1 dashboard.openwisp.org api.openwisp.org" | sudo tee -a /etc/hosts - # disable metric collection during builds - sed -i 's/METRIC_COLLECTION=True/METRIC_COLLECTION=False/' .env - - # the following action is equivalent to - # echo "$DOCKER_HUB_SECRET" | docker login --username "$DOCKER_HUB_USERNAME" --password-stdin - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_SECRET }} - - - name: Build & Publish to Docker Hub - run: | - make publish TAG=edge USER=docker.io/openwisp - env: - SELENIUM_HEADLESS: 1 - - - name: Login to GitLab Container Registry - uses: docker/login-action@v1 - with: - registry: registry.gitlab.com - username: ${{ secrets.GITLAB_DOCKER_REGISTRY_USER }} - password: ${{ secrets.GITLAB_DOCKER_REGISTRY_TOKEN }} - - # Skip image builds and tests since they were done when - # publishing to Docker Hub - - name: Build & Publish to GitLab Container Registry - run: | - make publish TAG=edge SKIP_BUILD=true SKIP_TESTS=true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d49fc1d8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,89 @@ +--- +name: Merge Tests + +on: + pull_request: + branches: + - master + +jobs: + build: + name: CI Build + runs-on: ubuntu-22.04 + steps: + - name: Git Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Setup testing environment + id: deps + run: | + sudo curl -sL -o /bin/hadolint "https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64" + sudo chmod +x /bin/hadolint + echo "127.0.0.1 dashboard.openwisp.org api.openwisp.org" | sudo tee -a /etc/hosts + # disable metric collection during builds + sed -i 's/METRIC_COLLECTION=True/METRIC_COLLECTION=False/' .env + sudo pip3 install -r requirements-test.txt + + - name: QA checks + run: ./run-qa-checks + + - name: Build Images + id: build_images + if: ${{ !cancelled() && steps.deps.conclusion == 'success' }} + run: make compose-build nfs-build + + - name: Use auto-install script to start containers + id: start_containers + if: ${{ !cancelled() && steps.build_images.conclusion == 'success' }} + # Do not remove the blank lines from the input. + run: | + (GIT_BRANCH="${{ github.head_ref }}" SKIP_PULL=true sudo -E ./deploy/auto-install.sh <