Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
BattleCh1cken committed May 8, 2024
1 parent c8b07e7 commit 95032fa
Showing 1 changed file with 54 additions and 38 deletions.
92 changes: 54 additions & 38 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ inputs:
description: Target repository
required: false
default: ${{ github.repository }}
upload-built-template:
library-name:
required: false
default: true
project-name:
required: false
default: ${{ github.repository }}
default: null

runs:
using: composite
Expand All @@ -24,7 +21,7 @@ runs:
- run: cp -r ./pros-project/* ./ # its incredibly silly that I have to do this but otherwise it interferes with other checkouts
shell: bash

- name: Check if template
- name: Check If Template
id: template
run: |
template=$(awk -F'=' '/^IS_LIBRARY:=/{print $2}' Makefile)
Expand All @@ -34,15 +31,15 @@ runs:
TEMPLATE: ${{ steps.template.outputs.template }}
shell: bash

- name: Get project info
if: ${{ steps.template.outputs.template == 1 && inputs.upload-built-template == true }}
- name: Get Project Info
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }}
id: project-info
shell: bash
run: |
if [ $ACTION = opened ]; then
# we have to get the head sha directly from the pr api, because github silly ig
echo "then"
sha=$(wget -O- --quiet https://api.github.com/repos/LemLib/LemLib/pulls/$PR_NUM | jq -r .head.sha | head -c 6)
sha=$(wget -O- --quiet https://api.github.com/repos/"${{inputs.repository}}"/pulls/$PR_NUM | jq -r .head.sha | head -c 6)
else
echo "else"
sha=$(echo "$AFTER" | head -c 6)
Expand Down Expand Up @@ -79,32 +76,51 @@ runs:
POSTFIX: ${{ steps.project-info.outputs.postfix }}
NAME: ${{ steps.project-info.outputs.name }}

#- name: Install ARM Toolchain
#uses: fiam/arm-none-eabi-gcc@v1
#with:
#release: "10-2020-q4"

#- name: Setup Python
#uses: actions/setup-python@v2
#with:
#python-version: 3.9

#- name: PIP Installer
#uses: BSFishy/pip-action@v1
#with:
#packages: pros-cli

#- name: Testing PROS Install
#run: pros --version
#shell: bash

#- name: Checkout
#uses: actions/checkout@v4
#with:
#repository: ${{ inputs.repository }}
#path: ./pros-project

#- name: Build PROS Project
#run: |
#make clean quick -j
#shell: bash
- name: Install ARM Toolchain
uses: fiam/arm-none-eabi-gcc@v1
with:
release: "10-2020-q4"

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: PIP Installer
uses: BSFishy/pip-action@v1
with:
packages: pros-cli

- name: Testing PROS Install
run: pros --version
shell: bash

- name: Build PROS Project
run: |
make clean quick -j
shell: bash

- name: Prepare Template
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }}
shell: bash
run: |
pros make template
mkdir -p template/include/lemlib/
cp {LICENSE,README.md} template/include/"${{inputs.library-name}}"/
echo "\n## [Github link](${{github.server_url}}/${{github.repository}})" >> template/include/"${{inputs.library-name}}"/README.md
perl -i -pe 's@(?<=[^/])(docs/assets/.*?)(?=[")])@${{github.server_url}}/${{github.repository}}/blob/master/$1?raw=true@g' template/include/"${{inputs.library-name}}"/README.md
echo $POSTFIX >> template/include/lemlib/VERSION
- name: Unzip Template
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }}
uses: montudor/[email protected]
with:
args: unzip "${{steps.project-info.outputs.name}}.zip" -d template

- name: Upload Artifact
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.template-name.outputs.name }}
path: "template/*"
retention-days: 89

0 comments on commit 95032fa

Please sign in to comment.