Test (PR #60): neon dist
: use copyArtifact
instead of copyFile
#354
Workflow file for this run
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: Test | |
run-name: | | |
${{ (github.event_name == 'pull_request' && format('Test (PR #{0}): {1}', github.event.number, github.event.pull_request.title)) | |
|| format('Test: {0}', github.event.head_commit.message) }} | |
on: | |
# Event: A maintainer has pushed commits or merged a PR to main. | |
push: | |
# Limiting push events to 'main' prevents duplicate runs of this workflow | |
# when maintainers push to internal PRs. | |
branches: | |
- main | |
# Event: A contributor has created or updated a PR. | |
pull_request: | |
types: [opened, synchronize, reopened, labeled] | |
branches: | |
- main | |
jobs: | |
pr: | |
name: Pull Request Details | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' }} | |
outputs: | |
branch: ${{ steps.pr-ref.outputs.branch || github.event.repository.default_branch }} | |
steps: | |
- name: PR Branch | |
id: pr-ref | |
shell: bash | |
run: echo "branch=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')" | tee -a "$GITHUB_OUTPUT" | |
env: | |
REPO: ${{ github.repository }} | |
PR_NO: ${{ github.event.number }} | |
GH_TOKEN: ${{ github.token }} | |
- name: Diagnostics | |
shell: bash | |
run: | | |
echo "***** github.event:" | |
cat <<GITHUB_EVENT_JSON | |
${{toJSON(github.event)}} | |
GITHUB_EVENT_JSON | |
echo "***** github.repository:" | |
cat <<GITHUB_REPOSITORY_JSON | |
${{toJSON(github.repository)}} | |
GITHUB_REPOSITORY_JSON | |
echo "***** github.head_ref:" | |
echo 'ref: ${{ github.event_name == 'issue_comment' && github.head_ref }}' | |
echo "***** github.event.repository.default_branch:" | |
echo '${{ github.event.repository.default_branch }}' | |
build-all: | |
name: Build | |
if: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:full-matrix') }} | |
needs: [pr] | |
permissions: | |
contents: write | |
uses: ./.github/workflows/build.yml | |
with: | |
ref: ${{ needs.pr.outputs.branch }} | |
update-version: true | |
github-release: false | |
bundles: | |
name: Check Bundles | |
runs-on: ubuntu-latest | |
steps: | |
- name: Diagnostics | |
shell: bash | |
run: | | |
cat <<GITHUB_EVENT_JSON | |
${{toJSON(github.event)}} | |
GITHUB_EVENT_JSON | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Check Bundles | |
shell: bash | |
run: ./test/lint/check-bundles.sh | |
integration: | |
name: Integration Tests | |
needs: [bundles] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Neon Environment | |
id: neon | |
uses: ./.github/actions/setup-neon | |
with: | |
platform: linux-x64-gnu | |
workspace: ./pkgs/cargo-messages | |
- name: Install Dependencies | |
shell: bash | |
run: npm ci --verbose | |
- name: Build | |
shell: bash | |
env: | |
CARGO_BUILD_TARGET: ${{ steps.neon.outputs.target }} | |
NEON_BUILD_PLATFORM: linux-x64-gnu | |
run: npm run build | |
working-directory: ./pkgs/cargo-messages | |
- name: Pack | |
shell: bash | |
run: npm pack ./platforms/linux-x64-gnu --pack-destination=${{ runner.temp }} | |
working-directory: ./pkgs/cargo-messages | |
- name: Start npm Proxy | |
shell: bash | |
working-directory: ./test/integration/proxy | |
timeout-minutes: 3 | |
run: ./ci-proxy.sh | |
- name: Publish to npm Proxy | |
shell: bash | |
working-directory: ./test/integration/proxy | |
timeout-minutes: 3 | |
run: ./publish.sh linux-x64-gnu | |
# Since package integrity checksums may vary depending on what versions | |
# are available in the proxy registry, we don't put the lockfile for this | |
# test in source control. This means we have to use `npm i`, not `npm ci`. | |
- name: Setup test-sniff-bytes Integration Test | |
shell: bash | |
working-directory: test/integration/test-sniff-bytes | |
run: npm i || (cat ../proxy/proxy.log && exit 1) | |
- name: Run test-sniff-bytes Integration Test | |
shell: bash | |
working-directory: test/integration/test-sniff-bytes | |
run: npm test |