Attempt to add caching #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
jobs: | ||
build_template: | ||
runs-on: ubuntu-latest | ||
env: | ||
TOOLCHAIN_UPDATE: 10.3-2021.10 | ||
steps: | ||
- name: Install SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: purduesigbots/pros | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- name: Retrieve gcc-arm-embedded from cache | ||
id: cache-gcc | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | ||
$(pwd)/gcc-arm-none-eabi-${TOOLCHAIN_UPDATE} | ||
key: | ||
gcc-non-eabi-${TOOLCHAIN_UPDATE} | ||
- name: Install gcc-arm-embedded | ||
if: steps.cache-gcc.outputs.cache-hit != 'true' | ||
run: | | ||
curl -LSso toolchain.tar.bz2 "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${TOOLCHAIN_UPDATE}/gcc-arm-none-eabi-${TOOLCHAIN_UPDATE}-x86_64-linux.tar.bz2" | ||
tar -xjvf toolchain.tar.bz2 | ||
- name: Upload gcc-arm-embedded to cache | ||
if: steps.cache-gcc.outputs.cache-hit != 'true | ||
Check failure on line 42 in .github/workflows/main.yml GitHub Actions / Build and PublishInvalid workflow file
|
||
uses: actions/cache/save@v4 | ||
with: | ||
path: | ||
$(pwd)/gcc-non-eabi-${TOOLCHAIN_UPDATE} | ||
key: | ||
gcc-non-eabi-${TOOLCHAIN_UPDATE} | ||
- name: Add gcc-arm-embedded to path | ||
run: echo "$(pwd)/gcc-arm-none-eabi-${TOOLCHAIN_UPDATE}/bin" >> $GITHUB_PATH | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Install CLI | ||
run: | | ||
pip install pros-cli | ||
- name: Build template | ||
run: | | ||
git submodule init | ||
git submodule update | ||
make template | ||
mkdir -p artifacts | ||
cp template/*.zip artifacts | ||
- name: Publish artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: artifacts/kernel@*.zip |