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

Refactor cross for GitHub Actions #1833

Merged
merged 1 commit into from
Nov 23, 2020
Merged

Conversation

crazy-max
Copy link
Member

Follow up #1824

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

@codecov-io
Copy link

codecov-io commented Nov 22, 2020

Codecov Report

Merging #1833 (6b32ab4) into master (cdef71b) will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1833      +/-   ##
==========================================
- Coverage   46.50%   46.44%   -0.06%     
==========================================
  Files         152      152              
  Lines       15281    15281              
==========================================
- Hits         7106     7098       -8     
- Misses       7143     7147       +4     
- Partials     1032     1036       +4     
Impacted Files Coverage Δ
cache/refs.go 50.73% <0.00%> (-0.99%) ⬇️
cache/contenthash/checksum.go 76.68% <0.00%> (-0.41%) ⬇️
cache/manager.go 54.32% <0.00%> (-0.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdef71b...6b32ab4. Read the comment docs.

@crazy-max crazy-max force-pushed the ghactions-build branch 3 times, most recently from 2998300 to 531c36e Compare November 23, 2020 01:20
@tonistiigi
Copy link
Member

like this?

jobs:
  base:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Cache ${{ env.CACHEKEY_BINARIES }}
        uses: actions/cache@v2
        with:
          path: /tmp/.buildkit-cache/${{ env.CACHEKEY_BINARIES }}
          key: ${{ runner.os }}-buildkit-${{ env.CACHEKEY_BINARIES }}-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildkit-${{ env.CACHEKEY_BINARIES }}-
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
        with:
          driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
      -
        name: Build ${{ env.CACHEKEY_BINARIES }}
        run: |
          ./hack/build_ci_first_pass binaries
        env:
          CACHE_DIR: /tmp/.buildkit-cache/${{ env.CACHEKEY_BINARIES }}

  test-base:
    runs-on: ubuntu-latest
    needs: [base]
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Cache ${{ env.CACHEKEY_INTEGRATION_TESTS }}
        uses: actions/cache@v2
        with:
          path: /tmp/.buildkit-cache/${{ env.CACHEKEY_INTEGRATION_TESTS }}
          key: ${{ runner.os }}-buildkit-${{ env.CACHEKEY_INTEGRATION_TESTS }}-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildkit-${{ env.CACHEKEY_INTEGRATION_TESTS }}-
      -
        name: Cache ${{ env.CACHEKEY_BINARIES }}
        uses: actions/cache@v2
        with:
          path: /tmp/.buildkit-cache/${{ env.CACHEKEY_BINARIES }}
          key: ${{ runner.os }}-buildkit-${{ env.CACHEKEY_BINARIES }}-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildkit-${{ env.CACHEKEY_BINARIES }}-
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
        with:
          driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
      -
        name: Build ${{ env.CACHEKEY_INTEGRATION_TESTS }}
        run: |
          ./hack/build_ci_first_pass integration-tests
        env:
          CACHE_DIR: /tmp/.buildkit-cache/${{ env.CACHEKEY_BINARIES }} /tmp/.buildkit-cache/${{ env.CACHEKEY_INTEGRATION_TESTS }}

  test:
    runs-on: ubuntu-latest
    needs: [test-base]

  cross:
    runs-on: ubuntu-latest
    needs: [base]

@crazy-max
Copy link
Member Author

@tonistiigi

CACHE_DIR: /tmp/.buildkit-cache/${{ env.CACHEKEY_BINARIES }} /tmp/.buildkit-cache/${{ env.CACHEKEY_INTEGRATION_TESTS }}

I didn't do this so I wouldn't have to deal with a list of local caches for integration-tests and mixup both caches. Maybe we could do this in a further PR?

@crazy-max crazy-max force-pushed the ghactions-build branch 2 times, most recently from cafcae0 to ea77b1b Compare November 23, 2020 17:45
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@tonistiigi
Copy link
Member

I didn't do this so I wouldn't have to deal with a list of local caches for integration-tests and mixup both caches. Maybe we could do this in a further PR?

Fine to leave it as follow-up. But importing from 2 locations shouldn't be a problem

@tonistiigi tonistiigi merged commit bdfc5d9 into moby:master Nov 23, 2020
@crazy-max crazy-max deleted the ghactions-build branch November 23, 2020 20:58
uses: crazy-max/ghaction-dump-context@v1

cross:
runs-on: ubuntu-latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should at least wait for base. Atm builds are duplicated

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

Successfully merging this pull request may close these issues.

None yet

3 participants