Skip to content

Commit

Permalink
ci: use caching instead action-download-artifact
Browse files Browse the repository at this point in the history
This is to avoid 'Server Error` on download, it could also speed up the
process a little.

Signed-off-by: Loic Devulder <ldevulder@suse.com>
  • Loading branch information
ldevulder committed Dec 2, 2022
1 parent ac2a237 commit a3c3fa9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
with:
name: iso-image
path: build/*.iso
- name: Cache ISO
uses: actions/cache@v3
env:
cache-name: cache-iso
with:
path: build/*.iso
key: iso-build-ci-${{ github.event.pull_request.head.sha || github.sha }}
- name: Send failed status to slack (only on schedule)
if: failure() && github.event_name == 'schedule'
uses: slackapi/slack-github-action@v1.23.0
Expand Down
30 changes: 14 additions & 16 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,20 @@ jobs:
checkName: build-all-artifacts
ref: ${{ github.event.pull_request.head.sha || github.sha }}
timeoutSeconds: 1800
- name: Download artifacts
uses: dawidd6/action-download-artifact@v2.24.0
- name: Cache ISO
uses: actions/cache@v3
env:
cache-name: cache-iso
with:
workflow: build-ci.yaml
run_id: ${{ github.event.workflow_run.id }}
name: iso-image
# Force the path, this is a security hint!
path: ./
path: build/*.iso
key: iso-build-ci-${{ github.event.pull_request.head.sha || github.sha }}
- name: Run tests
run: |
GIT_TAG=$(git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0")
GIT_COMMIT_SHORT=$(git rev-parse --short HEAD)
export CONTAINER_IMAGE=${REPO}:${GIT_TAG}-${GIT_COMMIT_SHORT}
export COS_HOST=127.0.0.1:2222
export ISO=$PWD/$(ls elemental-*.iso 2>/dev/null)
export ISO=$PWD/build/$(ls elemental-*.iso 2>/dev/null)
cd tests && make container-tests
- name: Upload logs
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -91,18 +90,17 @@ jobs:
checkName: build-all-artifacts
ref: ${{ github.event.pull_request.head.sha || github.sha }}
timeoutSeconds: 1800
- name: Download artifacts
uses: dawidd6/action-download-artifact@v2.24.0
- name: Cache ISO
uses: actions/cache@v3
env:
cache-name: cache-iso
with:
workflow: build-ci.yaml
run_id: ${{ github.event.workflow_run.id }}
name: iso-image
# Force the path, this is a security hint!
path: ./
path: build/*.iso
key: iso-build-ci-${{ github.event.pull_request.head.sha || github.sha }}
- name: Run tests
run: |
export COS_HOST=127.0.0.1:2222
export ISO=$PWD/$(ls elemental-*.iso 2>/dev/null)
export ISO=$PWD/build/$(ls elemental-*.iso 2>/dev/null)
cd tests && make iso-tests
- name: Upload logs
uses: actions/upload-artifact@v3
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/master-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,32 +134,32 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: '~1.18'
- name: Download default ISO
- name: Cache ISO
# NOTE: download the *default* ISO, not the one passed as a parameter
if: ${{ inputs.iso_to_test == '' }}
uses: dawidd6/action-download-artifact@v2.24.0
uses: actions/cache@v3
env:
cache-name: cache-iso
with:
workflow: ${{ inputs.workflow_download }}
workflow_conclusion: success
name: iso-image
# Force the path, this is a security hint!
path: ./
path: build/*.iso
key: iso-build-ci-${{ github.event.pull_request.head.sha || github.sha }}
# Alternate key, mainly useful for UI test
restore-keys: |
iso-build-ci-
- name: Download specified ISO
if: ${{ inputs.iso_to_test != '' }}
env:
ISO_TO_TEST: ${{ inputs.iso_to_test }}
TAG: from-obs
run: |
wget -v -L -c ${ISO_TO_TEST} -O elemental-${TAG}.iso
mkdir -p build
wget -v -L -c ${ISO_TO_TEST} -O build/elemental-${TAG}.iso
- name: Extract iPXE artifacts from ISO
run: |
# Extract TAG
ISO=$(ls elemental-*.iso 2>/dev/null)
ISO=$(ls build/elemental-*.iso 2>/dev/null)
TAG=${ISO#*-}
export TAG=${TAG%.iso}
# Move ISO to build for next step
mkdir -p build
mv -f ${ISO} build/
# Extract iPXE artifacts
make extract_kernel_init_squash
make ipxe
Expand Down

0 comments on commit a3c3fa9

Please sign in to comment.