Skip to content

Commit

Permalink
save & restore artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgomz committed Jul 18, 2024
1 parent 39d584c commit 68292cd
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,50 @@ jobs:
path: repository
classifier: .zip
group: org.alfresco

outputs:
artifact: ${{ steps.hash_matrix.outputs.artifacts_key }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7

- name: Hash matrix to use as a cache key
id: hash_matrix
run: |
echo "artifacts_key=$(echo ${{ matrix.images }} | jq -c | sha256sum)" >> $GITHUB_OUTPUT
- name: Setup .netrc
run: |
echo "machine nexus.alfresco.com" >> ~/.netrc
echo "login ${{ secrets.NEXUS_USERNAME }}" >> ~/.netrc
echo "password ${{ secrets.NEXUS_PASSWORD }}" >> ~/.netrc
- name: Fetch artifacts from nexus
run: ${{ github.workspace }}/scripts/fetch-artifact.sh ${{ matrix.images.artifact }} ${{ matrix.images.version }} ${{ matrix.images.classifier }} ${{ matrix.images.group }} ${{ matrix.images.path }}
run: >-
${{ github.workspace }}/scripts/fetch-artifact.sh
${{ matrix.images.artifact }}
${{ matrix.images.version }}
${{ matrix.images.classifier }}
${{ matrix.images.group }}
${{ matrix.images.path }}
working-directory: ${{ github.workspace }}


- name: Upload Artifacts for next job
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # 4.3.4
with:
name: ${{ github.run_id }}
path: /tmp/${{ matrix.images.name }}.tar

build-run-test:
runs-on: ubuntu-latest
needs: prepare_artifacts
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7

- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
with:
name: ${{ needs.prepare_artifacts.outputs.artifact }}

- name: Set up QEMU
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # 3.1.0

Expand Down

0 comments on commit 68292cd

Please sign in to comment.