forked from magma/magma
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (58 loc) · 2.16 KB
/
insync-checkin.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
# Copyright 2022 The Magma Authors.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# owner: @magma/approvers-cloud
# purpose: Ensure generated files are committed
# remediation: https://magma.github.io/magma/docs/next/orc8r/dev_testing
name: Orc8r Check Generated Files In Sync
on:
push:
branches:
- master
- 'v1.*'
pull_request:
branches:
- master
- 'v1.*'
types: [ opened, reopened, synchronize ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
insync-checkin:
name: insync checkin job
runs-on: ubuntu-20.04
env:
MAGMA_ROOT: "${{ github.workspace }}"
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # [email protected]
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # [email protected]
with:
python-version: '3.8.10'
- name: Run build.py
run: |
cd ${MAGMA_ROOT}/orc8r/cloud/docker
python3 build.py --generate
sudo chown -R $USER $MAGMA_ROOT/*
git add .
echo GIT_STATUS=$(git status) >> $GITHUB_ENV
git status
git diff-index --quiet HEAD
- name: Notify failure to Slack
if: failure() && github.event_name == 'push'
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 # [email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_CI }}
SLACK_TITLE: "Github action insync-checkin failed"
SLACK_USERNAME: ${{ github.workflow }}
SLACK_MESSAGE: ${{ github.event.head_commit.message || github.event.pull_request.title }}
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '