Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI chore #105

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 13 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ on: [push, workflow_dispatch]
env:
XC_VERSION: ${{ '15.1' }}
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "10"
CCACHE_COMPRESSLEVEL: "15"
CCACHE_MAXSIZE: "400M"
GH_TOKEN: ${{ github.token }}
BRANCH: ${{ github.ref }}

jobs:

Expand All @@ -19,71 +21,47 @@ jobs:
- name: Select latest Xcode
run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app"
- name: Install ccache
run: |
brew install ccache
which ccache
run: brew install ccache
- name: Cache ccache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/Library/Caches/ccache
key: ccache-${{ github.job }}-${{ matrix.configuration }}-${{ github.run_id }}
restore-keys: ccache-${{ github.job }}-${{ matrix.configuration }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build and run unit tests
run: "cd Scripts && ./run_all_unit_tests.sh ${{ matrix.configuration }}"
- name: Show ccache stats
run: "ccache --show-stats --verbose"
- name: Remove old ccache caches
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeys=$(gh actions-cache list --key ccache-${{ github.job }}-${{ matrix.configuration }}- | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeys
do
gh actions-cache delete $cacheKey --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ github.token }}
gh extension install actions/gh-actions-cache
gh actions-cache list -B $BRANCH --key ccache-${{ github.job }}-${{ matrix.configuration }}- | cut -f 1 | xargs -I {} gh actions-cache delete {} --confirm

build-unsigned:
runs-on: macos-13
steps:
- name: Select latest Xcode
run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app"
- name: Install deps
run: |
brew install ccache
brew install create-dmg
run: brew install ccache && brew install create-dmg
- name: Cache ccache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/Library/Caches/ccache
key: ccache-${{ github.job }}-${{ github.run_id }}
restore-keys: ccache-${{ github.job }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build and package
run: "cd Scripts && ./build_unsigned.sh"
- name: Show ccache stats
run: "ccache --show-stats --verbose"
- name: Remove old ccache caches
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeys=$(gh actions-cache list --key ccache-${{ github.job }}- | cut -f 1 )
# Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeys
do
gh actions-cache delete $cacheKey --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ github.token }}
gh extension install actions/gh-actions-cache
gh actions-cache list -B $BRANCH --key ccache-${{ github.job }}- | cut -f 1 | xargs -I {} gh actions-cache delete {} --confirm
- uses: actions/upload-artifact@v4
with:
name: nimble-commander-unsigned
Expand Down
Loading