diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 47a5ef8..9715bf8 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -8,65 +8,21 @@ on: schedule: - cron: '0 1 * * 0' -# https://docs.docker.com/build/ci/github-actions/share-image-jobs/ -# just using caches instead of artifact upload. jobs: - docker-build: + docker-build-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 - - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - - name: Create docker cache folder - run: mkdir -p /tmp/docker - - - name: Hash dockerfile - id: dockerfile-hash - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 - with: - patterns: builder.Dockerfile - - - name: Restore docker image - id: cache-docker - uses: actions/cache@v3 - with: - path: /tmp/docker - key: ${{ runner.os }}-docker-${{ steps.dockerfile-hash.outputs.hash }} - name: Build docker builder-image - if: steps.cache-docker.outputs.cache-hit != 'true' uses: docker/build-push-action@v4 with: context: . file: builder.Dockerfile tags: cproject-builder:latest - outputs: type=docker,dest=/tmp/docker/${{ runner.os }}-builder-image.tar - - build-and-test: - runs-on: ubuntu-latest - needs: docker-build - steps: - - uses: actions/checkout@v3 - - uses: docker/setup-buildx-action@v2 - - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - - name: Hash dockerfile - id: dockerfile-hash - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 - with: - patterns: builder.Dockerfile - - - name: Restore docker image - id: cache-docker - uses: actions/cache@v3 - with: - path: /tmp/docker - key: ${{ runner.os }}-docker-${{ steps.dockerfile-hash.outputs.hash }} + push: false + load: true - name: Build library uses: https://github.com/addnab/docker-run-action@v3 @@ -99,5 +55,3 @@ jobs: name: reports-${{github.run_number}} path: ${{ env.ASSET }} retention-days: 3 - -# TODO: delete cache on merge.