Skip to content

Commit

Permalink
RCC caching
Browse files Browse the repository at this point in the history
  • Loading branch information
jherbel committed Nov 28, 2023
1 parent 79f3086 commit 5ea979d
Showing 1 changed file with 42 additions and 15 deletions.
57 changes: 42 additions & 15 deletions .github/workflows/rcc.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,59 @@
---
name: "RCC"
name: "RCC cached upload"

on:
workflow_call: {}
workflow_call:
{}

env:
RCC_TAG: "v14.15.4"
GO_VERSION: "1.20.x"
RUBY_VERSION: "2.7"

jobs:
build_and_test:
restore_from_cache:
runs-on: ubuntu-latest
outputs:
cache_hit: ${{ steps.restore-from-cache.outputs.cache-hit }}
steps:
- id: restore-from-cache
uses: actions/cache/restore@v3
with:
path: build
key: rcc-${{ env.RCC_TAG }}-${{ env.GO_VERSION }}-${{ env.RUBY_VERSION }}

build_and_test:
runs-on: ubuntu-latest
needs:
- restore_from_cache
if: ${{ needs.restore_from_cache.outputs.cache_hit != 'true' }}
steps:
- uses: actions/checkout@v4
with:
repository: robocorp/rcc
ref: v14.15.4

ref: ${{ env.RCC_TAG }}
- uses: actions/setup-go@v3
with:
go-version: '1.20.x'

go-version: ${{ env.GO_VERSION }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'

ruby-version: ${{ env.RUBY_VERSION }}
- run: rake build

- run: rake test

- uses: actions/upload-artifact@v3
with:
path: build
if-no-files-found: error

upload_and_cache:
runs-on: ubuntu-latest
needs: build_and_test
# See https://github.com/actions/runner/issues/491 for the following condition
if: |
always() &&
(needs.build_and_test.result == 'success' || needs.build_and_test.result == 'skipped')
steps:
- uses: actions/cache/save@v3
with:
path: build
key: rcc-${{ env.RCC_TAG }}-${{ env.GO_VERSION }}-${{ env.RUBY_VERSION }}
- uses: actions/upload-artifact@v3
with:
path: build
if-no-files-found: error

0 comments on commit 5ea979d

Please sign in to comment.