Continuous Integration #31991
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: 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() |