Skip to content

Commit

Permalink
(#2400) Add caching of files to GitHub Action
Browse files Browse the repository at this point in the history
This will mean that Cake and the other tools/dependencies won't need to
be resolved/downloaded each time.
  • Loading branch information
gep13 committed Jun 23, 2022
1 parent 3ac35bc commit f3bb553
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 21 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build with Mono
run: |
chmod +x build.sh
Expand All @@ -38,6 +43,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build with .Net Framework
run: ./build.ps1 --verbosity=diagnostic --target=CI
- name: Upload Windows build results
Expand Down Expand Up @@ -70,6 +80,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build with Mono
run: |
chmod +x build.sh
Expand All @@ -89,19 +104,20 @@ jobs:
docker-build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up QEMU
- name: Cache Tools
uses: actions/cache@v2.1.6
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build and push
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
Expand Down
47 changes: 34 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Test with NUnit on Mono
run: |
chmod +x build.sh
Expand All @@ -33,6 +40,13 @@ jobs:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Test with NUnit on .Net Framework
run: .\build.bat --verbosity=diagnostic --target=test --testExecutionType=all
- name: Upload Windows build results
Expand All @@ -51,18 +65,25 @@ jobs:
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Test with NUnit on Mono
run: |
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Test with NUnit on Mono
run: |
chmod +x build.sh
$GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=test --testExecutionType=all
- name: Upload MacOS build results
uses: actions/upload-artifact@v2
# Always upload build results
if: ${{ always() }}
with:
name: macos-build-results
path: |
code_drop/TestResults/issues-report.html
code_drop/TestResults/NUnit/TestResult.xml
code_drop/MsBuild.log
- name: Upload MacOS build results
uses: actions/upload-artifact@v2
# Always upload build results
if: ${{ always() }}
with:
name: macos-build-results
path: |
code_drop/TestResults/issues-report.html
code_drop/TestResults/NUnit/TestResult.xml
code_drop/MsBuild.log

0 comments on commit f3bb553

Please sign in to comment.