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

👷Migrate to github actions #678

Open
wants to merge 22 commits into
base: develop-pros-3
Choose a base branch
from
Open
67 changes: 67 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build and Publish

on:
workflow_dispatch:
push:
branches:
- '*'

jobs:
build_template:
runs-on: ubuntu-latest

env:
TOOLCHAIN_UPDATE: 10.3-2021.10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TOOLCHAIN_UPDATE: 10.3-2021.10
TOOLCHAIN_UPDATE: 13.3.rel1

PROS uses v13.3rel1 since #703.


steps:

- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/checkout@v2
uses: actions/checkout@v4

with:
repository: purduesigbots/pros
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Retrieve gcc-arm-embedded from cache
id: cache-gcc
uses: actions/cache@v4
with:
path:
~/gcc-arm-none-eabi-${{env.TOOLCHAIN_UPDATE}}
key:
gcc-arm-none-eabi-${{env.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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"
curl -LSso toolchain.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu/${TOOLCHAIN_UPDATE}/binrel/arm-gnu-toolchain-${TOOLCHAIN_UPDATE}-x86_64-arm-none-eabi.tar.xz"

tar -xjvf toolchain.tar.bz2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tar -xjvf toolchain.tar.bz2
tar -xJvf toolchain.tar.xz


- 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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: '3.9'
python-version: '3.9'
cache: 'pip'


- 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
compression-level: 0
Loading