Skip to content

feat: Use GitHub Composite Actions #25

feat: Use GitHub Composite Actions

feat: Use GitHub Composite Actions #25

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- 'docs/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '**.md'
workflow_dispatch:
jobs:
single-job-test:
name: Test single job
runs-on: ubuntu-latest
steps:
- name: Checkout action
uses: actions/checkout@v3
with:
path: .github/actions/gha-jobid-action
- name: Run action with options
id: test1
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (1)"
repository: "Tiryoh/gha-jobid-action"
run_id: "1765707248"
- name: Verify
run: |
check_url() {
if [[ "$1" == "$2" ]]; then
echo "html_url OK"
else
echo "html_url ERROR" >&2
ERROR_FLAG=1
fi
}
check_job_id() {
if [[ "$1" == "$2" ]]; then
echo "job_id OK"
else
echo "job_id ERROR" >&2
ERROR_FLAG=1
fi
}
ERROR_FLAG=0
check_url "${{ steps.test1.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/1765707248/jobs/2440349148"
check_job_id "${{ steps.test1.outputs.job_id }}" "4990990752"
if [[ "$ERROR_FLAG" == 1 ]]; then
exit 1
fi
multi-jobs-test:
name: Test multi jobs
runs-on: ubuntu-latest
steps:
- name: Checkout action
uses: actions/checkout@v3
with:
path: .github/actions/gha-jobid-action
- name: Run action with options
id: test1
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (1)"
repository: "Tiryoh/gha-jobid-action"
run_id: "1765708149"
- name: Run action with options
id: test2
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (2)"
repository: "Tiryoh/gha-jobid-action"
run_id: "1765708149"
- name: Run action with options
id: test3
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (3)"
repository: "Tiryoh/gha-jobid-action"
run_id: "1765708149"
- name: Verify
run: |
check_url() {
if [[ "$1" == "$2" ]]; then
echo "html_url OK"
else
echo "html_url ERROR" >&2
ERROR_FLAG=1
fi
}
check_job_id() {
if [[ "$1" == "$2" ]]; then
echo "job_id OK"
else
echo "job_id ERROR" >&2
ERROR_FLAG=1
fi
}
ERROR_FLAG=0
check_url "${{ steps.test1.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/1765708149/jobs/2440350715"
check_job_id "${{ steps.test1.outputs.job_id }}" "4990992769"
check_url "${{ steps.test2.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/1765708149/jobs/2440350733"
check_job_id "${{ steps.test2.outputs.job_id }}" "4990992790"
check_url "${{ steps.test3.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/1765708149/jobs/2440350763"
check_job_id "${{ steps.test3.outputs.job_id }}" "4990992821"
if [[ "$ERROR_FLAG" == 1 ]]; then
exit 1
fi
multi-jobs-test-31:
name: Test multi jobs more than 30
runs-on: ubuntu-latest
steps:
- name: Checkout action
uses: actions/checkout@v3
with:
path: .github/actions/gha-jobid-action
- name: Run action with options
id: test1
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (1)"
repository: "Tiryoh/gha-jobid-action"
run_id: "1766315275"
- name: Run action with options
id: test2
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (2)"
repository: "Tiryoh/gha-jobid-action"
run_id: "1766315275"
- name: Run action with options
id: test3
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (31)"
repository: "Tiryoh/gha-jobid-action"
run_id: "1766315275"
per_page: 100
- name: Verify
run: |
check_url() {
if [[ "$1" == "$2" ]]; then
echo "html_url OK"
else
echo "html_url ERROR" >&2
ERROR_FLAG=1
fi
}
check_job_id() {
if [[ "$1" == "$2" ]]; then
echo "job_id OK"
else
echo "job_id ERROR" >&2
ERROR_FLAG=1
fi
}
ERROR_FLAG=0
check_url "${{ steps.test1.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/1766315275/jobs/2441320701"
check_job_id "${{ steps.test1.outputs.job_id }}" "4992187575"
check_url "${{ steps.test2.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/1766315275/jobs/2441320717"
check_job_id "${{ steps.test2.outputs.job_id }}" "4992187593"
check_url "${{ steps.test3.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/1766315275/jobs/2441321086"
check_job_id "${{ steps.test3.outputs.job_id }}" "4992188043"
if [[ "$ERROR_FLAG" == 1 ]]; then
exit 1
fi