Skip to content
Permalink
Browse files

Revert "Remove other workflows temporarily"

This reverts commit 4996223.
  • Loading branch information
nyalldawson committed Mar 22, 2021
1 parent d525439 commit 9f8ecabb36ff267584c349c6af4d8cebf07594f3
@@ -0,0 +1,18 @@
name: ♻ Backport
on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
runs-on: ubuntu-18.04
name: Backport
steps:
- name: Backport Bot
id: backport
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( join( github.event.pull_request.labels.*.name ), 'backport') ) || contains( github.event.label.name, 'backport' ) )
uses: m-kuhn/backport@v1.1.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,157 @@
name: 🐳 Build Docker images for current branches

# on commits to this file, schedule and dispatch runs, the workflow will build the 3 different Docker images (master, PR, LTR)
# on tags, it will build only the image of the given tag
# this is made by using a matrix defined in a dedicated job
on:
push:
tags:
- final-*
branches:
- master
paths:
- .github/workflows/build-docker.yml
schedule:
# runs every day
- cron: '0 0 * * *'
workflow_dispatch:
# POST https://api.github.com/repos/qgis/QGIS/actions/workflows/2264135/dispatches:

jobs:
define-strategy:
if: github.repository_owner == 'qgis'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- id: matrix
run: |
if [[ "${GITHUB_REF}" =~ ^refs/tags ]]; then
echo "::set-output name=matrix::{\"branch\":[\"${GITHUB_REF##*/}\"]}"
else
echo "::set-output name=matrix::{\"branch\":[\"master\", \"release-3_16\", \"release-3_18\"]}"
fi
build-docker:
if: github.repository_owner == 'qgis'
runs-on: ubuntu-latest
needs: define-strategy

env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CC: /usr/lib/ccache/gcc
CXX: /usr/lib/ccache/g++ # Building SIP binding freezes with Clang in Docker, maybe a SIP issue, maybe not
DOCKER_BUILD_DEPS_FILE: qgis3-build-deps.dockerfile

strategy:
matrix: ${{ fromJSON( needs.define-strategy.outputs.matrix ) }}

steps:
- name: Cache
id: cache
uses: actions/cache@v2.1.4
with:
path: ~/.ccache
key: docker-build-${{ matrix.branch }}-${{ github.sha }}
restore-keys: |
docker-build-${{ matrix.branch }}-
docker-build-master-
- name: checkout ${{ matrix.branch }}
uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}

- name: Define vars
env:
branch: ${{ matrix.branch }}
run: |
export DOCKER_TAG=${branch//master/latest}
export DOCKER_DEPS_TAG=${DOCKER_TAG}
# add vars for next steps
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
echo "DOCKER_DEPS_TAG=${DOCKER_DEPS_TAG}" >> $GITHUB_ENV
echo "branch: ${branch}"
echo "docker tag: ${DOCKER_TAG}"
echo "docker deps tag: ${DOCKER_DEPS_TAG}"
- name: Copy cache
run: |
[[ -d ~/.ccache ]] && echo "cache directory (~/.ccache) exists" || mkdir -p ~/.ccache
# copy ccache dir within QGIS source so it can be accessed from docker
cp -r ~/.ccache/. ./.ccache_image_build
- name: QGIS deps Docker pull/rebuild
run: |
cd .docker
docker --version
docker pull "qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}" || true
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}" -f ${DOCKER_BUILD_DEPS_FILE} .
echo "push to qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}"
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push "qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}"
- name: Docker QGIS build
run: |
cd .docker
DOCKER_BUILD_ARGS="--build-arg DOCKER_DEPS_TAG --build-arg CC --build-arg CXX"
docker build ${DOCKER_BUILD_ARGS} \
--cache-from "qgis/qgis:${DOCKER_TAG}" \
-t "qgis/qgis:BUILDER" \
-f qgis.dockerfile ..
- name: Tag container and copy cache
run: |
docker run --name qgis_container qgis/qgis:BUILDER /bin/true
docker cp qgis_container:/QGIS/build_exit_value ./build_exit_value
if [[ $(cat ./build_exit_value) != "OK" ]]; then
echo "Build failed, not pushing image"
exit 1
fi
echo "Copy build cache from Docker container to Travis cache directory"
rm -rf ~/.ccache/*
mkdir -p ~/.ccache
docker cp qgis_container:/QGIS/.ccache_image_build/. ~/.ccache
echo "Cache size: "$(du -sh ~/.ccache)
- name: Finalize image
run: |
cd .docker
# enable experimental features in Docker to squash
echo '{ "experimental": true}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
docker build ${DOCKER_BUILD_ARGS} \
--cache-from "qgis/qgis:BUILDER" \
--squash \
-t "qgis/qgis:${DOCKER_TAG}" \
-f qgis.dockerfile ..
- name: Pushing image to docker hub
run: |
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push "qgis/qgis:${DOCKER_TAG}"
- name: Trigger PyQGIS API docs build for ${{ matrix.branch }}
if: success() && !startsWith(github.ref, 'refs/tags/')
env:
branch: ${{ matrix.branch }}
run: |
body='{
"ref": "master",
"inputs": {"qgis_branch": "__QGIS_VERSION_BRANCH__"}
}'
body=$(sed "s/__QGIS_VERSION_BRANCH__/${branch}/;" <<< $body)
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GH_TOKEN}" \
https://api.github.com/repos/qgis/pyqgis/actions/workflows/2246440/dispatches \
-d "${body}"
@@ -0,0 +1,218 @@
name: 🧹 Code Layout

on:
push:
branches:
- master
- release-**
pull_request:

jobs:
documentation_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2.2.1
with:
python-version: 3.7
- name: Install Requirements
run: |
sudo apt install -y \
doxygen \
cpanminus \
libyaml-tiny-perl \
libio-socket-ssl-perl \
libhttp-date-perl \
libgetopt-long-descriptive-perl \
libmoo-perl \
libnamespace-clean-perl \
libpath-tiny-perl \
libpod-constants-perl \
libscalar-list-utils-perl \
libsort-key-perl \
libstrictures-perl \
libstring-escape-perl \
libtry-tiny-perl \
expect
cpanm --notest App::Licensecheck
python -m pip install --upgrade pip
pip install autopep8 nose2 mock termcolor
- name: Make
run: |
mkdir build
cd build
cmake -DWITH_SERVER=ON -DUSE_CCACHE=OFF -DWITH_CORE=OFF -DWITH_APIDOC=ON -DWITH_ASTYLE=ON -DENABLE_TESTS=ON -DWITH_DOT=NO -DWERROR=ON ..
make -j3 apidoc
- name: Run Tests
run: cd build && ctest -V -R PyQgsDocCoverage

license_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt install -y \
cpanminus
cpanm --notest App::Licensecheck
- name: Run License Check
run: ./tests/code_layout/test_licenses.sh

shell_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt install -y \
shellcheck
- name: Run Shellcheck
run: ./tests/code_layout/test_shellcheck.sh

banned_keywords_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Banned Keywords Test
run: ./tests/code_layout/test_banned_keywords.sh

def_window_title_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Def Window Title Test
run: ./tests/code_layout/test_defwindowtitle.sh

qvariant_no_brace_init:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: No brace initialization of QVariant variables
run: ./tests/code_layout/test_qvariant_no_brace_init.sh

qt_module_wide_imports:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: No module-wide imports of Qt modules
run: ./tests/code_layout/test_qt_imports.sh

doxygen_layout_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt install -y \
expect \
silversearcher-ag
- name: Doxygen Layout Test
run: ./tests/code_layout/test_doxygen_layout.sh

indentation_check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Install Requirements
run: |
sudo apt install -y \
astyle \
python3-autopep8 \
flip
- name: Indentation Test
run: ./scripts/verify_indentation.sh HEAD~1

spell_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt install -y \
expect \
silversearcher-ag
- uses: trilom/file-changes-action@v1.2.4
id: changed_files
with:
output: ' '
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Spell Test
run: ./scripts/spell_check/check_spelling.sh -r ${{ steps.changed_files.outputs.files_modified }} ${{ steps.changed_files.outputs.files_added }}

sip_check:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.7
uses: actions/setup-python@v2.2.1
with:
python-version: 3.7
- name: Install Requirements
run: |
sudo apt install -y \
cpanminus \
libyaml-tiny-perl \
libio-socket-ssl-perl \
libhttp-date-perl \
libgetopt-long-descriptive-perl \
libmoo-perl \
libnamespace-clean-perl \
libpath-tiny-perl \
libpod-constants-perl \
libscalar-list-utils-perl \
libsort-key-perl \
libstrictures-perl \
libstring-escape-perl \
libtry-tiny-perl \
expect
python -m pip install --upgrade pip
pip install autopep8 nose2 mock termcolor
- name: Checkout
uses: actions/checkout@v2
- name: Sip Checks
run: ./tests/code_layout/test_sipify.sh
- name: Sip Include Test
run: ./tests/code_layout/test_sip_include.sh
- name: Sip Files Up To Date
run: ./tests/code_layout/test_sipfiles.sh

cppcheck_16_04:
runs-on: ubuntu-16.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Requirements
run: |
sudo apt install -y cppcheck
- name: Run cppcheck test
run: ./scripts/cppcheck.sh

cppcheck_18_04:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Requirements
run: |
sudo apt install -y cppcheck
- name: Run cppcheck test
run: ./scripts/cppcheck.sh

0 comments on commit 9f8ecab

Please sign in to comment.