Skip to content

Commit

Permalink
Various optimizations (#7)
Browse files Browse the repository at this point in the history
* Update action.yml

* Update action.yml

Co-authored-by: David Leal <[email protected]>

* Update action.yml

* Update action.yml

---------

Co-authored-by: David Leal <[email protected]>
  • Loading branch information
mertcandav and Panquesito7 authored Aug 6, 2023
1 parent dee8d31 commit 76726b1
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,24 @@ runs:
echo "The action doesn't support building on Windows. Exiting script."
exit 1
fi
- name: Install Homebrew
- name: Install Homebrew if Needed
shell: bash
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [[ "$OSTYPE" == "darwin"* ]]; then
echo 'export PATH="/usr/local/bin:$PATH"' >> $GITHUB_PATH
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "export PATH=\$PATH:/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH
if [[ ${{ inputs.version }} == "latest" ]] || [[ ${{ inputs.version }} == "current" ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [[ "$OSTYPE" == "darwin"* ]]; then
echo 'export PATH="/usr/local/bin:$PATH"' >> $GITHUB_PATH
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "export PATH=\$PATH:/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH
fi
fi
- name: Install dependencies
shell: bash
run: |
brew update
brew install wget jq
if [[ ${{ inputs.version }} == "latest" ]] || [[ ${{ inputs.version }} == "current" ]]; then
brew update
brew install jq
fi
- name: Adjust directory
shell: bash
run: |
Expand All @@ -64,21 +68,21 @@ runs:
RELEASES=$(curl -s https://api.github.com/repos/julelang/jule/releases)
LATEST_RELEASE=$(echo "$RELEASES" | jq -r '.[] | select(.draft == false) | .tarball_url' | head -n 1)
wget $LATEST_RELEASE -O julec.tar.gz
curl -o julec.tar.gz $LATEST_RELEASE
mkdir -p ${{ inputs.directory }}/julec-latest
tar -xzf julec.tar.gz -C ${{ inputs.directory }}/julec-latest
elif [[ ${{ inputs.version }} == "dev" ]]; then
git clone https://github.com/julelang/jule.git ${{ inputs.directory }}/julec-${{ inputs.version }}
else
wget https://github.com/julelang/jule/archive/refs/tags/jule-${{ inputs.version }}.tar.gz -O julec.tar.gz
curl -o julec.tar.gz https://github.com/julelang/jule/archive/refs/tags/jule-${{ inputs.version }}.tar.gz -O julec.tar.gz
mkdir -p ${{ inputs.directory }}/julec-${{ inputs.version }}
tar -xzf julec.tar.gz -C ${{ inputs.directory }}/julec-${{ inputs.version }}
fi
- name: Get JuleC IR
shell: bash
run: |
cd ${{ inputs.directory }}/julec-${{ inputs.version }}
wget https://raw.githubusercontent.com/julelang/julec-ir/main/src/$( [[ "$OSTYPE" == "darwin"* ]] && echo darwin || echo linux)-${{ inputs.architecture }}.cpp -O ir.cpp
curl -o ir.cpp https://raw.githubusercontent.com/julelang/julec-ir/main/src/$( [[ "$OSTYPE" == "darwin"* ]] && echo darwin || echo linux)-${{ inputs.architecture }}.cpp
- name: Compile JuleC
shell: bash
run: |
Expand Down

0 comments on commit 76726b1

Please sign in to comment.