name: Test on: push: branches: - master paths-ignore: - '**.md' pull_request: paths-ignore: - '**.md' jobs: build: name: Build strategy: matrix: runs-on: [ubuntu-latest, macos-latest, windows-latest] fail-fast: false runs-on: ${{ matrix.runs-on }} steps: - name: Checkout uses: actions/checkout@v2 - name: Set Node.js 12.x uses: actions/setup-node@v1 with: node-version: 12.x - name: npm install run: npm install - name: Compile run: npm run build - name: Lint run: npm run lint - name: Format run: npm run format-check # Test end-to-end by uploading two artifacts and then downloading them # Once upload-artifact v2 is out of preview, switch over - name: Set artifact file contents run: | echo "::set-env name=non-gzip-artifact-content::hello" echo "::set-env name=gzip-artifact-content::Some_large_amount_of_text_that_has_a_compression_ratio_that_is_greater_than_100%._If_the_compression_ratio_is_greater_than_100%_gzip_is_used_to_upload_the_file." - name: Create artifacts run: | mkdir -p path/to/artifact-A mkdir -p path/to/artifact-B echo ${{ env.non-gzip-artifact-content }} > path/to/artifact-A/file-A.txt echo ${{ env.gzip-artifact-content }} > path/to/artifact-B/file-B.txt - name: Upload artifact A uses: actions/upload-artifact@v2 with: name: 'Artifact-A' path: path/to/artifact-A - name: Upload artifact B uses: actions/upload-artifact@v2 with: name: 'Artifact-B' path: path/to/artifact-B - name: Download artifact A with no extra folder (default) uses: ./ with: name: 'Artifact-A' path: download/with/artifact-folder/false - name: Verify successful download with no extra folder shell: bash run: | scripts/test-artifact-file.sh "download/with/artifact-folder/false/file-A.txt" "${{ env.non-gzip-artifact-content }}" - name: Download artifact A with artifact-folder set to true uses: ./ with: name: 'Artifact-A' path: download/with/artifact-folder/true artifact-folder: true - name: Verify successful download with an extra folder shell: bash run: | scripts/test-artifact-file.sh "download/with/artifact-folder/true/Artifact-A/file-A.txt" "${{ env.non-gzip-artifact-content }}" # Test downloading both artifacts at once - name: Download all Artifacts uses: ./ with: path: some/other/path - name: Verify downloadAllArtifacts() shell: bash run: | scripts/test-artifact-file.sh "some/other/path/Artifact-A/file-A.txt" "${{ env.non-gzip-artifact-content }}" scripts/test-artifact-file.sh "some/other/path/Artifact-B/file-B.txt" "${{ env.gzip-artifact-content }}"