Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage #3

Open
Erriez opened this issue Aug 14, 2021 · 0 comments
Open

Usage #3

Erriez opened this issue Aug 14, 2021 · 0 comments

Comments

@Erriez
Copy link

Erriez commented Aug 14, 2021

Thanks for creating this workaround for issue nektos/act#329. How is this project supposed to work?

I have a .github/workflows/CI.yaml:

jobs:
  build:
    name: Build images
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Cache buildx layers
        uses: actions/cache@v2
        with:
          path: /tmp/buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-

This generates the output:

act
...
[CI/Build images] ⭐  Run Cache buildx layers
INFO[0001]   ☁  git clone 'https://github.com/actions/cache' # ref=v2 
[CI/Build images]   🐳  docker cp src=/home/a/.cache/act/actions-cache@v2/ dst=/var/run/act/actions/actions-cache@v2/
[CI/Build images]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/actions-cache@v2/] user=
[CI/Build images]   🐳  docker exec cmd=[node /var/run/act/actions/actions-cache@v2/dist/restore/index.js] user=
[CI/Build images]   ❓  ::save-state name=CACHE_KEY::Linux-buildx-3a96bf21701334370d6ffda25c4d7c5f6409ddf0
[CI/Build images]   💬  ::debug::Resolved Keys:
[CI/Build images]   💬  ::debug::["Linux-buildx-3a96bf21701334370d6ffda25c4d7c5f6409ddf0","Linux-buildx-"]
[CI/Build images]   💬  ::debug::Checking zstd --version
[CI/Build images]   💬  ::debug::*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
[CI/Build images]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[CI/Build images]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache.
| [warning]getCacheEntry failed: Cache Service Url not found, unable to restore cache.
[CI/Build images]   ⚙  ::set-output:: cache-hit=false

Then I cloned this application:

git clone https://github.com/anthonykawa/artifact-server.git
cd artifact-server
npm install
npm run start
    ...
    Listening on port 8080

I've added the environment variable to the end of Cache buildx layers (not sure if this is correct):

        env:
          ACTIONS_CACHE_URL: "localhost:8080/"

Run again:

act
...
[CI/Build images]   💬  ::debug::Resource Url: localhost:8080/_apis/artifactcache/cache?keys=Linux-buildx-3a96bf21701334370d6ffda25c4d7c5f6409ddf0%252CLinux-buildx-&version=7db6cb4c78cbac0d95563089572776322af57c580ca11c70393999edb6ca4e4c
[CI/Build images]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: connect ECONNREFUSED 127.0.0.1:80
[CI/Build images]   💬  ::debug::Resource Url: localhost:8080/_apis/artifactcache/cache?keys=Linux-buildx-3a96bf21701334370d6ffda25c4d7c5f6409ddf0%252CLinux-buildx-&version=7db6cb4c78cbac0d95563089572776322af57c580ca11c70393999edb6ca4e4c
[CI/Build images]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: connect ECONNREFUSED 127.0.0.1:80

It tries to connect, but looks like /_apis/artifactcache/ is not resolved. Any idea? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant