commit
c7d193f32e
|
@ -10,9 +10,11 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
paths-ignore:
|
||||||
- main
|
- '**.md'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -20,33 +22,32 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node 16
|
- name: Setup Node 20
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.x
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Move the committed index.js file
|
- name: Rebuild the dist/ directory
|
||||||
run: mv dist/index.js /tmp
|
|
||||||
|
|
||||||
- name: Rebuild with tsc
|
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Rebuild the index.js file
|
- name: Compare the expected and actual dist/ directories
|
||||||
run: npm run release
|
run: |
|
||||||
|
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||||
- name: Compare the expected and actual index.js files
|
echo "Detected uncommitted changes after build. See status below:"
|
||||||
run: git diff --ignore-all-space dist/index.js /tmp/index.js
|
git diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
id: diff
|
id: diff
|
||||||
|
|
||||||
# If index.js was different than expected, upload the expected version as an artifact
|
# If index.js was different than expected, upload the expected version as an artifact
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4-beta
|
||||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||||
with:
|
with:
|
||||||
name: index.js
|
name: dist
|
||||||
path: dist/index.js
|
path: dist/
|
||||||
|
|
|
@ -13,7 +13,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Check licenses
|
name: Check licenses
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- name: Install licensed
|
- name: Install licensed
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
name: Test
|
name: Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -10,7 +11,6 @@ on:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
|
@ -23,12 +23,12 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node 16
|
- name: Setup Node 20
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.x
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
@ -54,33 +54,26 @@ jobs:
|
||||||
mkdir -p path/to/dir-3
|
mkdir -p path/to/dir-3
|
||||||
echo "Lorem ipsum dolor sit amet" > path/to/dir-1/file1.txt
|
echo "Lorem ipsum dolor sit amet" > path/to/dir-1/file1.txt
|
||||||
echo "Hello world from file #2" > path/to/dir-2/file2.txt
|
echo "Hello world from file #2" > path/to/dir-2/file2.txt
|
||||||
echo "This is a going to be a test for a large enough file that should get compressed with GZip. The @actions/artifact package uses GZip to upload files. This text should have a compression ratio greater than 100% so it should get uploaded using GZip" > path/to/dir-3/gzip.txt
|
|
||||||
|
|
||||||
# Upload a single file artifact
|
# Upload a single file artifact
|
||||||
- name: 'Upload artifact #1'
|
- name: 'Upload artifact #1'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
name: 'Artifact-A'
|
name: 'Artifact-A-${{ matrix.runs-on }}'
|
||||||
path: path/to/dir-1/file1.txt
|
path: path/to/dir-1/file1.txt
|
||||||
|
|
||||||
# Upload using a wildcard pattern, name should default to 'artifact' if not provided
|
# Upload using a wildcard pattern
|
||||||
- name: 'Upload artifact #2'
|
- name: 'Upload artifact #2'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
name: 'Artifact-Wildcard-${{ matrix.runs-on }}'
|
||||||
path: path/**/dir*/
|
path: path/**/dir*/
|
||||||
|
|
||||||
# Upload a directory that contains a file that will be uploaded with GZip
|
# Upload a multi-path artifact
|
||||||
- name: 'Upload artifact #3'
|
- name: 'Upload artifact #3'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
name: 'GZip-Artifact'
|
name: 'Multi-Path-Artifact-${{ matrix.runs-on }}'
|
||||||
path: path/to/dir-3/
|
|
||||||
|
|
||||||
# Upload a directory that contains a file that will be uploaded with GZip
|
|
||||||
- name: 'Upload artifact #4'
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
name: 'Multi-Path-Artifact'
|
|
||||||
path: |
|
path: |
|
||||||
path/to/dir-1/*
|
path/to/dir-1/*
|
||||||
path/to/dir-[23]/*
|
path/to/dir-[23]/*
|
||||||
|
@ -88,9 +81,9 @@ jobs:
|
||||||
|
|
||||||
# Download Artifact #1 and verify the correctness of the content
|
# Download Artifact #1 and verify the correctness of the content
|
||||||
- name: 'Download artifact #1'
|
- name: 'Download artifact #1'
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4-beta
|
||||||
with:
|
with:
|
||||||
name: 'Artifact-A'
|
name: 'Artifact-A-${{ matrix.runs-on }}'
|
||||||
path: some/new/path
|
path: some/new/path
|
||||||
|
|
||||||
- name: 'Verify Artifact #1'
|
- name: 'Verify Artifact #1'
|
||||||
|
@ -108,9 +101,9 @@ jobs:
|
||||||
|
|
||||||
# Download Artifact #2 and verify the correctness of the content
|
# Download Artifact #2 and verify the correctness of the content
|
||||||
- name: 'Download artifact #2'
|
- name: 'Download artifact #2'
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4-beta
|
||||||
with:
|
with:
|
||||||
name: 'artifact'
|
name: 'Artifact-Wildcard-${{ matrix.runs-on }}'
|
||||||
path: some/other/path
|
path: some/other/path
|
||||||
|
|
||||||
- name: 'Verify Artifact #2'
|
- name: 'Verify Artifact #2'
|
||||||
|
@ -127,31 +120,11 @@ jobs:
|
||||||
}
|
}
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
# Download Artifact #3 and verify the correctness of the content
|
# Download Artifact #4 and verify the correctness of the content
|
||||||
- name: 'Download artifact #3'
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: 'GZip-Artifact'
|
|
||||||
path: gzip/artifact/path
|
|
||||||
|
|
||||||
# Because a directory was used as input during the upload the parent directories, path/to/dir-3/, should not be included in the uploaded artifact
|
|
||||||
- name: 'Verify Artifact #3'
|
|
||||||
run: |
|
|
||||||
$gzipFile = "gzip/artifact/path/gzip.txt"
|
|
||||||
if(!(Test-Path -path $gzipFile))
|
|
||||||
{
|
|
||||||
Write-Error "Expected file do not exist"
|
|
||||||
}
|
|
||||||
if(!((Get-Content $gzipFile) -ceq "This is a going to be a test for a large enough file that should get compressed with GZip. The @actions/artifact package uses GZip to upload files. This text should have a compression ratio greater than 100% so it should get uploaded using GZip"))
|
|
||||||
{
|
|
||||||
Write-Error "File contents of downloaded artifact is incorrect"
|
|
||||||
}
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: 'Download artifact #4'
|
- name: 'Download artifact #4'
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4-beta
|
||||||
with:
|
with:
|
||||||
name: 'Multi-Path-Artifact'
|
name: 'Multi-Path-Artifact-${{ matrix.runs-on }}'
|
||||||
path: multi/artifact
|
path: multi/artifact
|
||||||
|
|
||||||
- name: 'Verify Artifact #4'
|
- name: 'Verify Artifact #4'
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue