-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (77 loc) · 2.82 KB
/
ci.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
name: Continuous Integration
on:
schedule:
- cron: '*/15 * * * *' # Every 15 minutes
pull_request:
push:
branches:
- main
- 'releases/*'
workflow_dispatch:
jobs:
nscloud-runner:
name: GitHub Actions Test on Nscloud Runner
runs-on: [nscloud-ubuntu-22.04-amd64-2x4-with-cache, nscloud-git-mirror-5gb]
steps:
- name: Github Checkout current
uses: actions/checkout@v4
- name: Namespace Checkout Current
uses: ./ # Uses an action in the root directory
with:
path: nscloud-current
- name: Compare current
run: |
if cmp --silent -- action.yml nscloud-current/action.yml; then
echo "files contents are identical"
else
echo "files differ:"
diff action.yml nscloud-current/action.yml
exit 1
fi
- name: Github Checkout main
uses: actions/checkout@v4
with:
path: github-main
- name: Namespace Checkout main
uses: ./ # Uses an action in the root directory
with:
path: nscloud-main
- name: Compare main
run: |
if cmp --silent -- github-main/action.yml nscloud-main/action.yml; then
echo "files contents are identical"
else
echo "files differ:"
diff github-main/action.yml nscloud-main/action.yml
exit 1
fi
# (NSL-4050) Test for ref using tags
- name: Namespace Checkout main
uses: ./ # Uses an action in the root directory
with:
path: NSL-4050-main
ref: refs/tags/v4
- name: Compare main
run: |
if [ "$(git -C ./NSL-4050-main rev-parse HEAD)" = "e10c48a9b2a3b8a4c18f51f13cca12846febe160" ] ; then
echo "commmit is identical"
else
echo "not expected commit for tag v4, expected e10c48a9b2a3b8a4c18f51f13cca12846febe160"
exit 1
fi
- uses: ruby/action-slack@v3.2.1
with:
payload: |
{
"attachments": [{
"title": "Checkout action failed on nscloud runners! Check now: ${{ job.status }}: ${{ github.workflow }}",
"title_link": "https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks",
"text": "${{ github.repository }}@${{ github.ref }}: <https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>",
"fields": [{ "value": ${{ toJson(github.event.head_commit.message) }}, "short": false }],
"footer": "${{ github.event.head_commit.committer.name }} at ${{ github.event.head_commit.timestamp }}",
"color": "danger"
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()