Skip to content

Commit

Permalink
ci(*): Add independant keepalive workflow and refactor add-ons test
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Aug 25, 2023
1 parent 852c1f1 commit a5c19c8
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 82 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/add-on-disable-checkout-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Add-on with disabled checkout tests
name: Disable checkout test
on:
push:
branches:
Expand All @@ -13,34 +13,33 @@ on:
workflow_dispatch:

permissions:
contents: write

contents: read

jobs:
add-on-disable-checkout-test:
disable-checkout-test:
strategy:
fail-fast: false
matrix:
ddev_version: [ stable ]
add_on: ["JanoPL/ddev-kibana"]

name: Add-on with disabled checkout tests
name: Disable checkout test
runs-on: ubuntu-latest

env:
ADD_ON: JanoPL/ddev-kibana
ADD_ON_REF: v1.4.0

steps:

- name: Clone current repository
uses: actions/checkout@v3

- name: Retrieve last tag of add-on
run: |
echo "ADD_ON_LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/${{ matrix.add_on }}/releases/latest | grep -oP "\/tag\/\K(.*)$")" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ matrix.add_on }}
ref: ${{ env.ADD_ON_LAST_TAG }}
repository: ${{ env.ADD_ON }}
ref: ${{ env.ADD_ON_REF }}
path: tested-addon
submodules: 'true'

Expand All @@ -49,8 +48,8 @@ jobs:
with:
ddev_version: ${{ matrix.ddev_version }}
token: ${{ secrets.GITHUB_TOKEN }}
addon_repository: ${{ matrix.add_on }}
addon_ref: ${{ env.ADD_ON_LAST_TAG }}
addon_repository: ${{ env.ADD_ON }}
addon_ref: ${{ env.ADD_ON_REF }}
addon_path: tested-addon
keepalive: false
disable_checkout_action: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Multiple add-ons test
name: Add-ons test
on:
push:
branches:
Expand All @@ -13,15 +13,25 @@ on:
workflow_dispatch:

permissions:
contents: write
contents: read

jobs:
multiple-add-ons-test:
add-ons-test:
strategy:
fail-fast: false
matrix:
ddev_version: [ stable ]
add_on: ["ddev/ddev-redis-commander", "ddev/ddev-mongo", "ddev/ddev-adminer"]
ddev_version: [ stable, HEAD ]
add_on:
- ddev/ddev-redis-commander
- ddev/ddev-mongo
- ddev/ddev-adminer
- ddev/ddev-redis
- ddev/ddev-solr
- ddev/ddev-sqlsrv
- ddev/ddev-pdfreactor
- ddev/ddev-memcached
- ddev/ddev-cron
- ddev/ddev-elasticsearch

name: Add-on test
runs-on: ubuntu-latest
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/keepalive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Keep Alive
on:

schedule:
- cron: '0 3 * * *'

permissions:
contents: write

jobs:
keep-alive:

name: Keep Alive
runs-on: ubuntu-latest

steps:

- name: Clone project files
uses: actions/checkout@v3

# keepalive-workflow adds a dummy commit if there's no other action here, keeps
# GitHub from turning off tests after 60 days
- uses: gautamkrishnar/keepalive-workflow@v1
with:
commit_message: "chore(*): Automated commit to keep the repository active"
time_elapsed: 55
1 change: 0 additions & 1 deletion .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
- uses: technote-space/toc-generator@v4
with:
MAX_HEADER_LEVEL: 3
COMMIT_NAME: Okaeli Dev Bot
TARGET_PATHS: 'README.md'
CHECK_ONLY_DEFAULT_BRANCH: true
CREATE_PR: true
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ jobs:
- name: Set outputs
id: set-outputs
run: |
echo "version_number=${{ env.VERSION_NUMBER}}" >> $GITHUB_OUTPUT
echo "major_tag=${{ env.MAJOR_TAG}}" >> $GITHUB_OUTPUT
echo "version_number=${{ env.VERSION_NUMBER }}" >> $GITHUB_OUTPUT
echo "major_tag=${{ env.MAJOR_TAG }}" >> $GITHUB_OUTPUT
update-major-tag:
name: Update major tag
Expand All @@ -146,7 +146,7 @@ jobs:
fetch-depth: 0

- name: Move or create the major tag
run: git tag -f ${{needs.create-release.outputs.major_tag}} ${{needs.create-release.outputs.version_number}}
run: git tag -f ${{ needs.create-release.outputs.major_tag }} ${{ needs.create-release.outputs.version_number }}

- name: Push the major tag
run: git push origin ${{needs.create-release.outputs.major_tag}} --force
run: git push origin ${{ needs.create-release.outputs.major_tag }} --force
56 changes: 0 additions & 56 deletions .github/workflows/single-add-on-test.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

[![Version](https://img.shields.io/github/v/release/ddev/github-action-add-on-test)](https://github.comddev/github-action-add-on-test/releases)
![project is maintained](https://img.shields.io/maintenance/yes/2024.svg)
[![tests](https://github.com/ddev/github-action-add-on-test/actions/workflows/single-add-on-test.yml/badge.svg)](https://github.com/ddev/github-action-add-on-test/actions/workflows/single-add-on-test.yml)
[![tests](https://github.com/ddev/github-action-add-on-test/actions/workflows/adds-on-test.yml/badge.svg)]
(https://github.com/ddev/github-action-add-on-test/actions/workflows/add-ons-test.yml)


<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -190,7 +191,6 @@ on:
permissions:
contents: write
jobs:
tests:
Expand Down
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ runs:

branding:
icon: "code"
color: "green"
color: "blue"

0 comments on commit a5c19c8

Please sign in to comment.