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

feat: macOS runner support #37

Merged
merged 12 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 8 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
5 changes: 3 additions & 2 deletions .github/workflows/test_ape_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,25 @@ concurrency:
jobs:
run-this-action:
name: Run action (${{ matrix.version }})
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
antazoey marked this conversation as resolved.
Show resolved Hide resolved
version:
[
'default',
'0.8.10',
'==0.8.10',
'git+https://github.com/ApeWorX/ape.git@main',
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Check version pin
id: check-version
run: |
if [[ ${{ matrix.version }} == "default" ]]; then
if [[ "${{ matrix.version }}" == "default" ]]; then
echo "ape-version=''" >> $GITHUB_OUTPUT
else
echo "ape-version=${{ matrix.version }}" >> $GITHUB_OUTPUT
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ concurrency:
jobs:
run-this-action:
name: Run action (${{ matrix.plugins }})
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
plugins: [
'default_with_version_config',
'default_without_version_in_config',
'tokens',
'tokens==0.8.0'
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

Expand All @@ -37,7 +38,7 @@ jobs:

if [[ "${{ matrix.plugins }}" == "default_without_version_in_config" ]]; then
# Remove the version so it defaults to `. -U`.
sed -i 's/version: 0.8.0//g' "ape-config.yaml"
awk '!/version: 0.8.0/' "ape-config.yaml" > "ape-config.tmp" && mv "ape-config.tmp" "ape-config.yaml"
fi

- name: Run ape action
Expand Down
25 changes: 14 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,18 @@ runs:
# in the cache action:
# https://github.com/actions/cache/issues/1241

if [ ! -d "/home/runner/.solcx" ]; then
mkdir "/home/runner/.solcx"
echo "Solcx directory created."
fi
if [ ! -d "/home/runner/.vvm" ]; then
mkdir "/home/runner/.vvm"
echo "VVM directory created."
fi
if [ ! -d "${{ github.workspace }}/.build" ]; then
mkdir "${{ github.workspace }}/.build"
echo ".build directory created."
# NOTE: If /home/runner does not exist, mkdir fails.
if [ -d "$HOME" ]; then
Copy link
Member Author

Choose a reason for hiding this comment

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

ok turns out the problem is github-action never caches when using a mac runner because the name of the directory here was wrong. I am thinking changing it to $HOME variable will fix. I will know soon.

if [ ! -d "$HOME/.solcx" ]; then
mkdir "$HOME/.solcx"
echo "Solcx directory created."
fi
if [ ! -d "$HOME/.vvm" ]; then
mkdir "$HOME/.vvm"
echo "VVM directory created."
fi
if [ ! -d "$HOME/.build" ]; then
mkdir "$HOME/.build"
echo ".build directory created."
fi
fi
Loading