-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
180df90
commit 2cb013b
Showing
2 changed files
with
23 additions
and
141 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,8 @@ | ||
name: '[v4] Test and Release' | ||
name: "[v5] Test and Release" | ||
on: [push, pull_request] | ||
jobs: | ||
check-v3compatibility: | ||
name: 'Check v3 compatibility' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Load using v4.x with prefix | ||
uses: ./ | ||
with: | ||
prefix: V4_ | ||
short-length: 8 | ||
|
||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Validate // Partial variables | ||
run: | | ||
[[ "${{ env.GITHUB_REPOSITORY_OWNER_PART }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_NAME_PART }}" == "${{ env.V4_GITHUB_REPOSITORY_NAME_PART }}" ]] | ||
shell: bash | ||
|
||
- name: Validate // Slug variables | ||
run: | | ||
[[ "${{ env.GITHUB_REPOSITORY_SLUG }}" == "${{ env.V4_GITHUB_REPOSITORY_SLUG }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_OWNER_PART_SLUG }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART_SLUG }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG }}" == "${{ env.V4_GITHUB_REPOSITORY_NAME_PART_SLUG }}" ]] | ||
[[ "${{ env.GITHUB_REF_SLUG }}" == "${{ env.V4_GITHUB_REF_SLUG }}" ]] | ||
[[ "${{ env.GITHUB_HEAD_REF_SLUG }}" == "${{ env.V4_GITHUB_HEAD_REF_SLUG }}" ]] | ||
[[ "${{ env.GITHUB_BASE_REF_SLUG }}" == "${{ env.V4_GITHUB_BASE_REF_SLUG }}" ]] | ||
[[ "${{ env.GITHUB_EVENT_REF_SLUG }}" == "${{ env.V4_GITHUB_EVENT_REF_SLUG }}" ]] | ||
shell: bash | ||
- name: Validate // Slug variables (Case Sensitive) | ||
run: | | ||
[[ "${{ env.GITHUB_REPOSITORY_SLUG_CS }}" == "${{ env.V4_GITHUB_REPOSITORY_SLUG_CS }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_OWNER_PART_SLUG_CS }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART_SLUG_CS }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG_CS }}" == "${{ env.V4_GITHUB_REPOSITORY_NAME_PART_SLUG_CS }}" ]] | ||
[[ "${{ env.GITHUB_REF_SLUG_CS }}" == "${{ env.V4_GITHUB_REF_SLUG_CS }}" ]] | ||
[[ "${{ env.GITHUB_HEAD_REF_SLUG_CS }}" == "${{ env.V4_GITHUB_HEAD_REF_SLUG_CS }}" ]] | ||
[[ "${{ env.GITHUB_BASE_REF_SLUG_CS }}" == "${{ env.V4_GITHUB_BASE_REF_SLUG_CS }}" ]] | ||
[[ "${{ env.GITHUB_EVENT_REF_SLUG_CS }}" == "${{ env.V4_GITHUB_EVENT_REF_SLUG_CS }}" ]] | ||
shell: bash | ||
- name: Validate // Slug URL variables | ||
run: | | ||
[[ "${{ env.GITHUB_REPOSITORY_SLUG_URL }}" == "${{ env.V4_GITHUB_REPOSITORY_SLUG_URL }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_OWNER_PART_SLUG_URL }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART_SLUG_URL }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG_URL }}" == "${{ env.V4_GITHUB_REPOSITORY_NAME_PART_SLUG_URL }}" ]] | ||
[[ "${{ env.GITHUB_REF_SLUG_URL }}" == "${{ env.V4_GITHUB_REF_SLUG_URL }}" ]] | ||
[[ "${{ env.GITHUB_HEAD_REF_SLUG_URL }}" == "${{ env.V4_GITHUB_HEAD_REF_SLUG_URL }}" ]] | ||
[[ "${{ env.GITHUB_BASE_REF_SLUG_URL }}" == "${{ env.V4_GITHUB_BASE_REF_SLUG_URL }}" ]] | ||
[[ "${{ env.GITHUB_EVENT_REF_SLUG_URL }}" == "${{ env.V4_GITHUB_EVENT_REF_SLUG_URL }}" ]] | ||
shell: bash | ||
- name: Validate // Slug URL variables (Case Sensitive) | ||
run: | | ||
[[ "${{ env.GITHUB_REPOSITORY_SLUG_URL_CS }}" == "${{ env.V4_GITHUB_REPOSITORY_SLUG_URL_CS }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_OWNER_PART_SLUG_URL_CS }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART_SLUG_URL_CS }}" ]] | ||
[[ "${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG_URL_CS }}" == "${{ env.V4_GITHUB_REPOSITORY_NAME_PART_SLUG_URL_CS }}" ]] | ||
[[ "${{ env.GITHUB_REF_SLUG_URL_CS }}" == "${{ env.V4_GITHUB_REF_SLUG_URL_CS }}" ]] | ||
[[ "${{ env.GITHUB_HEAD_REF_SLUG_URL_CS }}" == "${{ env.V4_GITHUB_HEAD_REF_SLUG_URL_CS }}" ]] | ||
[[ "${{ env.GITHUB_BASE_REF_SLUG_URL_CS }}" == "${{ env.V4_GITHUB_BASE_REF_SLUG_URL_CS }}" ]] | ||
[[ "${{ env.GITHUB_EVENT_REF_SLUG_URL_CS }}" == "${{ env.V4_GITHUB_EVENT_REF_SLUG_URL_CS }}" ]] | ||
shell: bash | ||
|
||
- name: Validate // Ref Name | ||
run: | | ||
[[ "${{ env.GITHUB_REF_NAME }}" == "${{ env.V4_GITHUB_REF_NAME }}" ]] | ||
[[ "${{ env.GITHUB_REF_NAME_SLUG }}" == "${{ env.V4_GITHUB_REF_NAME_SLUG }}" ]] | ||
[[ "${{ env.GITHUB_REF_NAME_SLUG_URL }}" == "${{ env.V4_GITHUB_REF_NAME_SLUG_URL }}" ]] | ||
[[ "${{ env.GITHUB_REF_NAME_SLUG_CS }}" == "${{ env.V4_GITHUB_REF_NAME_SLUG_CS }}" ]] | ||
[[ "${{ env.GITHUB_REF_NAME_SLUG_URL_CS }}" == "${{ env.V4_GITHUB_REF_NAME_SLUG_URL_CS }}" ]] | ||
shell: bash | ||
|
||
- name: Validate // Short SHA variables | ||
run: | | ||
[[ "${{ env.GITHUB_SHA_SHORT }}" == "${{ env.V4_GITHUB_SHA_SHORT }}" ]] | ||
[[ "${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" == "${{ env.V4_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" ]] | ||
shell: bash | ||
|
||
check-v3compatibility-without-checkout: | ||
name: 'Check v3 compatibility (without checkout)' | ||
needs: | ||
- check-v3compatibility | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: this-action | ||
ref: ${{ github.ref }} | ||
|
||
- name: Load using v4.x with prefix | ||
uses: ./this-action | ||
with: | ||
prefix: V4_ | ||
short-length: 8 | ||
|
||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Validate // Short SHA variables | ||
run: | | ||
[[ "${{ env.GITHUB_SHA_SHORT }}" == "${{ env.V4_GITHUB_SHA_SHORT }}" ]] | ||
[[ "${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" == "${{ env.V4_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" ]] | ||
shell: bash | ||
|
||
display: | ||
name: 'Display produced variables' | ||
name: "Display produced variables" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -125,7 +12,7 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Load using v4.x | ||
- name: Load using v5.x | ||
uses: ./ | ||
|
||
- name: Partial variables | ||
|
@@ -144,6 +31,7 @@ jobs: | |
echo "base ref : ${{ env.GITHUB_BASE_REF_SLUG }}" | ||
echo "event ref : ${{ env.GITHUB_EVENT_REF_SLUG }}" | ||
shell: bash | ||
|
||
- name: Slug variables (Case Sensitive) | ||
run: | | ||
echo "repository : ${{ env.GITHUB_REPOSITORY_SLUG_CS }}" | ||
|
@@ -154,6 +42,7 @@ jobs: | |
echo "base ref : ${{ env.GITHUB_BASE_REF_SLUG_CS }}" | ||
echo "event ref : ${{ env.GITHUB_EVENT_REF_SLUG_CS }}" | ||
shell: bash | ||
|
||
- name: Slug URL variables | ||
run: | | ||
echo "repository : ${{ env.GITHUB_REPOSITORY_SLUG_URL }}" | ||
|
@@ -164,6 +53,7 @@ jobs: | |
echo "base ref : ${{ env.GITHUB_BASE_REF_SLUG_URL }}" | ||
echo "event ref : ${{ env.GITHUB_EVENT_REF_SLUG_URL }}" | ||
shell: bash | ||
|
||
- name: Slug URL variables (Case Sensitive) | ||
run: | | ||
echo "repository : ${{ env.GITHUB_REPOSITORY_SLUG_URL_CS }}" | ||
|
@@ -191,7 +81,7 @@ jobs: | |
shell: bash | ||
|
||
display-without-checkout: | ||
name: 'Display produced variables (without checkout)' | ||
name: "Display produced variables (without checkout)" | ||
needs: | ||
- display | ||
strategy: | ||
|
@@ -206,14 +96,8 @@ jobs: | |
path: this-action | ||
ref: ${{ github.ref }} | ||
|
||
- name: Load using v4.x with prefix | ||
- name: Load using v5.x | ||
uses: ./this-action | ||
with: | ||
prefix: V4_ | ||
short-length: 8 | ||
|
||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Short SHA variables | ||
run: | | ||
|
@@ -236,7 +120,7 @@ jobs: | |
- name: Using correct short length | ||
uses: ./ | ||
with: | ||
prefix: 'CSL_' | ||
prefix: "CSL_" | ||
short-length: 4 | ||
- name: Using correct length // Validate that all short variables lengths are equals to short-length | ||
run: | | ||
|
@@ -248,8 +132,8 @@ jobs: | |
id: using-wrong-short-length | ||
uses: ./ | ||
with: | ||
prefix: 'WSL_' | ||
short-length: 'wrong' | ||
prefix: "WSL_" | ||
short-length: "wrong" | ||
continue-on-error: true | ||
- name: Using wrong short length // Validate that the action end with an error | ||
run: | | ||
|
@@ -278,7 +162,7 @@ jobs: | |
- name: Using correct short length | ||
uses: ./this-action | ||
with: | ||
prefix: 'CSL_' | ||
prefix: "CSL_" | ||
short-length: 4 | ||
- name: Using correct length // Validate that all short variables lengths are equals to short-length | ||
run: | | ||
|
@@ -290,7 +174,7 @@ jobs: | |
id: using-empty-short-length | ||
uses: ./this-action | ||
with: | ||
prefix: 'ESL_' | ||
prefix: "ESL_" | ||
continue-on-error: true | ||
- name: Using empty short length // Validate that the action don't end with an error | ||
run: | | ||
|
@@ -304,8 +188,8 @@ jobs: | |
id: using-wrong-short-length | ||
uses: ./this-action | ||
with: | ||
prefix: 'WSL_' | ||
short-length: 'wrong' | ||
prefix: "WSL_" | ||
short-length: "wrong" | ||
continue-on-error: true | ||
- name: Using wrong short length // Validate that the action end with an error | ||
run: | | ||
|
@@ -329,7 +213,7 @@ jobs: | |
- name: Using correct slug max length | ||
uses: ./ | ||
with: | ||
prefix: 'CML_' | ||
prefix: "CML_" | ||
slug-maxlength: 1 | ||
- name: Using correct max length // Validate that all slug variables lengths are equals or under the slug-maxlength | ||
run: | | ||
|
@@ -341,8 +225,8 @@ jobs: | |
id: using-wrong-slug-max-length | ||
uses: ./ | ||
with: | ||
prefix: 'WML_' | ||
slug-maxlength: 'wrong' | ||
prefix: "WML_" | ||
slug-maxlength: "wrong" | ||
continue-on-error: true | ||
- name: Using wrong slug max length // Validate that the action end with an error | ||
run: | | ||
|
@@ -356,8 +240,8 @@ jobs: | |
id: using-empty-slug-max-length | ||
uses: ./ | ||
with: | ||
prefix: 'EML_' | ||
slug-maxlength: '' | ||
prefix: "EML_" | ||
slug-maxlength: "" | ||
continue-on-error: true | ||
- name: Using empty slug max length // Validate that the action end with an error | ||
run: | | ||
|
@@ -371,8 +255,8 @@ jobs: | |
id: using-nolimit-slug-max-length | ||
uses: ./ | ||
with: | ||
prefix: 'NLML_' | ||
slug-maxlength: 'nolimit' | ||
prefix: "NLML_" | ||
slug-maxlength: "nolimit" | ||
- name: Using no limit on slug max length // Validate that the action end with an error | ||
run: | | ||
[[ "$(env | grep "NLML_" | grep "_SLUG" | wc -l)" -gt 0 ]] | ||
|
@@ -385,7 +269,6 @@ jobs: | |
concurrency: | ||
group: release-${{ github.ref }}-${{ github.event_name }} | ||
needs: | ||
- check-v3compatibility-without-checkout | ||
- display-without-checkout | ||
- input-short-length-without-checkout | ||
- input-slug-maxlength | ||
|