Run package promotion checks on all distros #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package Quality Check | |
on: | |
push: | |
jobs: | |
check-package: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository submodules | |
uses: actions/checkout@v3 | |
- name: Install SSH key | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.GH_SERVICE_ACCT_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
- name: Install meta | |
run: | | |
npm i --location=global meta | |
- name: Clone repositories using meta | |
run: | | |
meta git update | |
- name: Show directory content | |
run: | | |
meta exec "ls -l" --parallel | |
# TODO: evaluate performing multiple greps at once: | |
# [ $(grep -e word1 -e word2 FILE | uniq -c | wc -l) -eq 2 ] && echo "found both" | |
- name: Check that debian/changelog is correctly formatted | |
run: | | |
meta exec "[ ! -f debian/changelog ] && { echo 'No changelog'; } || { head -n1 debian/changelog grep -q 'buster' && { echo 'Distribution: OK'; } || { echo 'Distribution: Not OK'; }; }" --parallel | |
meta exec "[ ! -f debian/changelog ] && { echo 'No changelog'; } || { head -n1 debian/changelog grep -q 'urgency=medium' && { echo 'Urgency: OK'; } || { echo 'Urgency: Not OK'; }; }" --parallel | |
- name: Check that debian/clean is correctly formatted | |
run: | | |
meta exec "[ ! -f debian/clean ] && { echo 'No debian/clean file'; } || { grep -q '^tar-ignore = Jenkinsfile$' debian/clean && { echo 'clean file: OK'; } || { echo 'clean file: Missing Jenkinsfile'; }; }" --parallel | |
meta exec "[ ! -f debian/clean ] && { echo 'No debian/clean file'; } || { grep -q '^tar-ignore = .github$' debian/clean && { echo 'clean file: OK'; } || { echo 'clean file: Missing .git'; }; }" --parallel | |
- name: Check that debian/source/options is correctly formatted | |
run: | | |
meta exec "[ ! -f debian/source/options ] && { echo 'No debian/source/options file'; } || { grep -q '^tar-ignore = Jenkinsfile$' debian/source/options && { echo 'source/options: OK'; } || { echo 'source/options: Missing Jenkinsfile'; }; }" --parallel | |
meta exec "[ ! -f debian/source/options ] && { echo 'No debian/source/options file'; } || { grep -q '^tar-ignore = Jenkinsfile$' debian/source/options && { echo 'source/options: OK'; } || { echo 'source/options: Missing Jenkinsfile'; }; }" --parallel | |
meta exec "[ ! -f debian/source/options ] && { echo 'No debian/source/options file'; } || { grep -q '^tar-ignore = .github$' debian/source/options && { echo 'source/options: OK'; } || { echo 'source/options: Missing .git'; }; }" --parallel | |
- name: Check that pre-commit is configured correctly | |
run: | | |
meta exec "[ ! -f .pre-commit-config.yaml ] && { echo 'No pre-commit config'; } || { pre-commit autoupdate && { echo 'Pre-commit up-to-date: OK'; } || { echo 'Pre-commit up-to-date: Not OK'; }; }" --parallel | |
meta exec "[ ! -f .pre-commit-config.yaml ] && { echo 'No pre-commit config'; } || { grep -q 'id: trailing-whitespace' .pre-commit-config.yaml && { echo 'Pre-commit has global settings: OK'; } || { echo 'Pre-commit has global settings: Not OK'; }; }" --parallel | |
meta exec "[ ! -f .pre-commit-config.yaml ] && { echo 'No pre-commit config'; } || { grep -q 'id: end-of-file-fixer' .pre-commit-config.yaml && { echo 'Pre-commit has global settings: OK'; } || { echo 'Pre-commit has global settings: Not OK'; }; }" --parallel | |
meta exec "[ ! -f .pre-commit-config.yaml ] && { echo 'No pre-commit config'; } || { grep -q 'id: check-added-large-files' .pre-commit-config.yaml && { echo 'Pre-commit has global settings: OK'; } || { echo 'Pre-commit has global settings: Not OK'; }; }" --parallel | |
meta exec "[ ! -f .pre-commit-config.yaml ] && { echo 'No pre-commit config'; } || { grep -q 'id: check-symlinks' .pre-commit-config.yaml && { echo 'Pre-commit has global settings: OK'; } || { echo 'Pre-commit has global settings: Not OK'; }; }" --parallel |