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

Fix CI #19

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29

- name: Install arturo
uses: curl -sSL https://get.arturo-lang.io/latest | sh
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev libmpfr-dev

- name: Install Arturo
run: bin/install-arturo
Copy link
Member Author

Choose a reason for hiding this comment

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

@BNAndras I'm not using the https://github.com/arturo-lang/arturo-action action as that compiles everything from scratch, which is quite slow

env:
GH_TOKEN: ${{ github.token }}

- name: Verify all exercises
run: bin/verify-exercises
43 changes: 43 additions & 0 deletions bin/install-arturo
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash

# Synopsis:
# Install arturo

# We currently install the nightly version as that has features we use.
# Once the next stable version has been released, we can use that.

# Uncomment the below line once https://github.com/arturo-lang/arturo/issues/1644 is fixed
# curl -sSL https://get.arturo-lang.io/latest | sh

function download_nightly() {
local install_dir="${1}"
local install_file="${install_dir}/arturo-full.tar.gz"
local repo="arturo-lang/nightly"

tag=$(gh release view --repo "${repo}" --json tagName --jq '.tagName')
gh release download --repo "${repo}" --pattern '*-full.tar.gz' --output "${install_file}" --skip-existing "${tag}"

tar -xzf "${install_file}" -C "${install_dir}"
rm -f "${install_file}"
}

function update_shell {
local install_dir="${1}"
local file="${HOME}/${2}"

if [[ -f "${file}" ]]; then
echo "export PATH=${install_dir}:\$PATH" >> "${file}"
source "${file}"
fi
}

install_dir="${HOME}/.arturo/bin"

download_nightly "${install_dir}"

if [[ -z "${GITHUB_ACTIONS}" ]]; then
update_shell "${install_dir}" ".bashrc"
update_shell "${install_dir}" ".zshrc"
else
echo "${install_dir}" >> "${GITHUB_PATH}"
fi