Download Artifacts Missing Files

I’m using the upload/download artifacts actions to reuse build outputs between jobs on the split-install-jobs branch of this repo.

Here’s the job for creating the build outputs:

build:
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]

    steps:
      - uses: actions/checkout@v2
      - run: cargo install --path .
      - uses: actions/upload-artifact@v2
        with:
          name: flowistry-build
          path: |
            ~/.cargo/bin/cargo-flowistry
            ~/.cargo/bin/flowistry-driver

And this job attempts to test the project using the build (with added steps for debugging the missing files):

test:
    needs: build
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]

    steps:
      - uses: actions/checkout@v2
      - name: Retrieve Flowistry build
        uses: actions/download-artifact@v2
        with:
          name: flowistry-build
          path: |
            ~/.cargo/bin/cargo-flowistry
            ~/.cargo/bin/flowistry-driver
      - run: ls -a ~
      - run: ls ~/.cargo/bin/
      - run: ls -l ~/.cargo/bin/flowistry-driver
      - run: cargo flowistry forward_slice
      - run: cargo test
      - run: npm ci
        working-directory: ide
      - name: Run vscode tests
        run: xvfb-run -a npm test
        working-directory: ide

Here’s an example run of the workflows.

The artifacts from the action summary contains both cargo-flowistry and flowistry-driver:
image

The output for ls ~/.cargo/bin/ in the workflow contains cargo-flowistry, but not flowistry-driver. And running ls -l ~/.cargo/bin/flowistry-driver confirms the file doesn’t exist:

ls: cannot access '/home/runner/.cargo/bin/flowistry-driver': No such file or directory

As you sort of discovered here:

the path field for actions/download-artifact@v2 in:

      - name: Retrieve Flowistry build
        uses: actions/download-artifact@v2
        with:
          name: flowistry-build
          path: "this-is-a-single-path-not-a-list-of-paths"

… is a single directory (or sorts) into which artifacts are expanded.

If you found the documentation confusing, I’d encourage you to file a bug against the repository.

1 Like

Ah, that makes sense. The documentation seems good, more of an oversight on my part. Thanks!

1 Like