Adjust workflows

This commit is contained in:
cytopia
2020-09-15 15:46:48 +02:00
parent ca6b176620
commit 6a49ffce10
4 changed files with 17 additions and 127 deletions

View File

@@ -62,14 +62,11 @@ jobs:
build: build:
name: "[ ${{ matrix.version }} ]" name: "[ PHP-${{ matrix.version }} ]"
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: False fail-fast: False
matrix: matrix:
# Adding all targets and only run them if they exist.
# Prevents us from forgetting to update this in case
# we add new envs in terragrunt.
version: version:
- '5.2' - '5.2'
- '5.3' - '5.3'
@@ -88,7 +85,7 @@ jobs:
# Checkout repository # Checkout repository
# ------------------------------------------------------------ # ------------------------------------------------------------
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v1 uses: actions/checkout@v2
- name: Set variables - name: Set variables
id: vars id: vars
@@ -105,7 +102,6 @@ jobs:
GIT_SLUG="${GITHUB_REF/refs\/heads\//}" GIT_SLUG="${GITHUB_REF/refs\/heads\//}"
fi fi
fi fi
# Export variable # Export variable
# # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-environment-variable-set-env # # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-environment-variable-set-env
echo ::set-env name=GIT_TYPE::${GIT_TYPE} echo ::set-env name=GIT_TYPE::${GIT_TYPE}
@@ -278,7 +274,6 @@ jobs:
# ------------------------------------------------------------ # ------------------------------------------------------------
# Push build artifacts # Push build artifacts
# ------------------------------------------------------------ # ------------------------------------------------------------
# Only run this, if the PR was created by the repo owner # Only run this, if the PR was created by the repo owner
- name: Publish images (only repo owner) - name: Publish images (only repo owner)
run: | run: |

View File

@@ -62,14 +62,11 @@ jobs:
build: build:
name: "[ ${{ matrix.version }} ]" name: "[ PHP-${{ matrix.version }} (ref: ${{ matrix.refs }}) ]"
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: False fail-fast: False
matrix: matrix:
# Adding all targets and only run them if they exist.
# Prevents us from forgetting to update this in case
# we add new envs in terragrunt.
version: version:
- '5.2' - '5.2'
- '5.3' - '5.3'
@@ -82,30 +79,34 @@ jobs:
- '7.3' - '7.3'
- '7.4' - '7.4'
- '8.0' - '8.0'
refs:
- 'master'
- '0.111'
- '0.112'
steps: steps:
# ------------------------------------------------------------ # ------------------------------------------------------------
# Checkout repository # Checkout repository
# ------------------------------------------------------------ # ------------------------------------------------------------
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v1 uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.refs }}
- name: Set variables - name: Set variables
id: vars id: vars
run: | run: |
# Set git branch or git tag as slug # Set git branch or git tag as slug
if [[ ${GITHUB_REF} =~ ^refs\/tags\/ ]]; then if [ -n "$( git tag --points-at HEAD )" ]; then
GIT_TYPE=TAG GIT_TYPE=TAG
GIT_SLUG="${GITHUB_REF/refs\/tags\//}" GIT SLUG="$( git tag --points-at HEAD )"
else elif [ "$( git rev-parse --abbrev-ref HEAD )" != "HEAD" ]; then
GIT_TYPE=BRANCH GIT_TYPE=BRANCH
if [ -n "${GITHUB_HEAD_REF}" ]; then GIT SLUG="$( git rev-parse --abbrev-ref HEAD )"
GIT_SLUG="${GITHUB_HEAD_REF}"
else else
GIT_SLUG="${GITHUB_REF/refs\/heads\//}" false
fi fi
fi
# Export variable # Export variable
# # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-environment-variable-set-env # # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-environment-variable-set-env
echo ::set-env name=GIT_TYPE::${GIT_TYPE} echo ::set-env name=GIT_TYPE::${GIT_TYPE}
@@ -278,7 +279,6 @@ jobs:
# ------------------------------------------------------------ # ------------------------------------------------------------
# Push build artifacts # Push build artifacts
# ------------------------------------------------------------ # ------------------------------------------------------------
# Only run this, if the PR was created by the repo owner # Only run this, if the PR was created by the repo owner
- name: Publish images (only repo owner) - name: Publish images (only repo owner)
run: | run: |

View File

@@ -1,97 +0,0 @@
---
name: schedule
on:
schedule:
- cron: '*/5 * * * *'
jobs:
build:
name: "[ PHP-${{ matrix.version }} (ref: ${{ matrix.refs }}) ]"
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
version:
- '5.2'
- '5.3'
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
refs:
- 'master'
- '0.110'
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.refs }}
- name: Show git info
run: |
git branch
git log | head
- name: Set variables
id: vars
run: |
if [ -n "$( git tag --points-at HEAD )" ]; then
GIT_TYPE=TAG
GIT_SLUG="$( git tag --points-at HEAD )"
elif [ "$( git rev-parse --abbrev-ref HEAD )" != "HEAD" ]; then
GIT_TYPE=BRANCH
GIT_SLUG="$( git rev-parse --abbrev-ref HEAD )"
else
false
fi
echo ::set-env name=GIT_TYPE::${GIT_TYPE}
echo ::set-env name=GIT_SLUG::${GIT_SLUG}
- name: Publish images (only repo owner)
run: |
retry() {
for n in $(seq ${RETRIES}); do
echo "[${n}/${RETRIES}] ${*}";
if eval "${*}"; then
return 0;
fi;
sleep 10;
done;
return 1;
}
# Info output
echo "Git Type: ${GIT_TYPE}"
echo "Git Slug: ${GIT_SLUG}"
# Login
echo "retry make login USER= PASS="
# Push
if [ "${GIT_TYPE}" = "TAG" ]; then
echo "retry make push-base VERSION=${VERSION}-${GIT_SLUG}"
echo "retry make push-mods VERSION=${VERSION}-${GIT_SLUG}"
echo "retry make push-prod VERSION=${VERSION}-${GIT_SLUG}"
echo "retry make push-work VERSION=${VERSION}-${GIT_SLUG}"
else
if [ "${GIT_SLUG}" = "master" ]; then
echo "retry make push-base VERSION=${VERSION}"
echo "retry make push-mods VERSION=${VERSION}"
echo "retry make push-prod VERSION=${VERSION}"
echo "retry make push-work VERSION=${VERSION}"
else
echo "retry make push-base VERSION=${VERSION}-${GIT_SLUG}"
echo "retry make push-mods VERSION=${VERSION}-${GIT_SLUG}"
echo "retry make push-prod VERSION=${VERSION}-${GIT_SLUG}"
echo "retry make push-work VERSION=${VERSION}-${GIT_SLUG}"
fi
fi
env:
VERSION: ${{ matrix.version }}
RETRIES: 5

View File

@@ -69,10 +69,6 @@ install:
### Check generation changes, build and test ### Check generation changes, build and test
### ###
before_script: before_script:
# Regenerate Dockerfiles and make sure nothing has changed (every stage)
- make gen-dockerfiles
- git diff --quiet || { echo "Build Changes"; git diff; git status; false; }
# Build (multiple tries due to network outages) # Build (multiple tries due to network outages)
- retry make build-base VERSION=${PHP} - retry make build-base VERSION=${PHP}
#- retry make test-base VERSION=${PHP} #- retry make test-base VERSION=${PHP}
@@ -86,10 +82,6 @@ before_script:
- retry make build-work VERSION=${PHP} - retry make build-work VERSION=${PHP}
- retry make test-work VERSION=${PHP} - retry make test-work VERSION=${PHP}
# Test if PHP modules have changed
- make gen-readme VERSION=${PHP}
- git diff --quiet || { echo "Build Changes"; git diff; git status; false; }
### ###
### Push to Dockerhub ### Push to Dockerhub