-
Notifications
You must be signed in to change notification settings - Fork 11
104 lines (102 loc) · 4.67 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2021 - 2023
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
name: Scheduled Versions and Dictionary verification
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions: read-all
jobs:
check-versions:
name: Update python requirements files
permissions:
contents: write # for technote-space/create-pr-action to push code
pull-requests: write # for technote-space/create-pr-action to create a PR
strategy:
max-parallel: 1
fail-fast: false
matrix:
image:
[
"docker.io/library/debian:11",
"docker.io/library/ubuntu:22.04",
"docker.io/library/rockylinux:9",
]
os_release: ["2023.1", "2023.2", "2024.1"]
container:
image: ${{ matrix.image }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
- name: install dependencies
shell: bash
run: |
source /etc/os-release || source /usr/lib/os-release
case ${ID,,} in
ubuntu|debian)
apt update
INSTALLER_CMD="apt-get -y --no-install-recommends -q=3 install"
;;
rhel|centos|fedora|rocky)
INSTALLER_CMD="$(command -v dnf || command -v yum) -y --quiet --errorlevel=0 install"
;;
esac
$INSTALLER_CMD python3-pip git
pip3 install pip-tools
- uses: technote-space/create-pr-action@91114507cf92349bec0a9a501c2edf1635427bc5 # 2.1.4
with:
EXECUTE_COMMANDS: |
bash -c 'source /etc/os-release; pip-compile --output-file="requirements/${{ matrix.os_release }}/${ID,,}_${VERSION_ID%.*}.txt" "requirements/${{ matrix.os_release }}/${ID,,}_${VERSION_ID%.*}.in" --upgrade'
COMMIT_MESSAGE: "Upgrade OpenStack Kolla dependencies"
COMMIT_NAME: "electrocucaracha bot"
PR_BRANCH_NAME: "versions-update-${PR_ID}"
PR_TITLE: "chore: update versions"
check-dictionary:
runs-on: ubuntu-latest
permissions:
contents: write # for technote-space/create-pr-action to push code
pull-requests: write # for technote-space/create-pr-action to create a PR
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
- uses: technote-space/create-pr-action@91114507cf92349bec0a9a501c2edf1635427bc5 # 2.1.4
with:
EXECUTE_COMMANDS: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install aspell aspell-en
pip install pyspelling
sort --ignore-case --output=original.dic .github/.wordlist.txt
echo "" > .github/.wordlist.txt
# Remove leftovers
pyspelling -c .spellcheck.yml | sed '/^<.*>/d;/^!!!/d;/^--/d;/^Misspelled words:/d;/^$/d;/^Spelling check passed :)$/d' | sort --ignore-case | uniq --ignore-case | tee draft.dic
comm -12 --nocheck-order draft.dic original.dic > .github/.wordlist.txt
sort --ignore-case --output=.github/.wordlist.txt .github/.wordlist.txt
# Add missing words
pyspelling -c .spellcheck.yml | sed '/^<.*>/d;/^!!!/d;/^--/d;/^Misspelled words:/d;/^$/d;/^Spelling check passed :)$/d' | sort --ignore-case | uniq --ignore-case | tee --append .github/.wordlist.txt
sort --ignore-case --output=.github/.wordlist.txt .github/.wordlist.txt
COMMIT_MESSAGE: "Update dictionary definitions"
COMMIT_NAME: "spellchecker bot"
PR_BRANCH_NAME: "versions-update-${PR_ID}"
PR_TITLE: "chore: update dictionary"
check-github-actions:
runs-on: ubuntu-latest
permissions:
contents: write # for technote-space/create-pr-action to push code
pull-requests: write # for technote-space/create-pr-action to create a PR
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
- uses: technote-space/create-pr-action@91114507cf92349bec0a9a501c2edf1635427bc5 # 2.1.4
with:
EXECUTE_COMMANDS: |
./ci/update_versions.sh
COMMIT_MESSAGE: "Update GitHub Actions"
COMMIT_NAME: "gh versions bot"
PR_BRANCH_NAME: "gh-versions-update-${PR_ID}"
PR_TITLE: "chore: update gh"