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
Changes from 10 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
9 changes: 5 additions & 4 deletions .github/workflows/test_ape_version.yaml
Original file line number Diff line number Diff line change
@@ -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',
'0.8.24',
'==0.8.24',
'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
7 changes: 4 additions & 3 deletions .github/workflows/test_plugins.yaml
Original file line number Diff line number Diff line change
@@ -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'
'tokens==0.8.3'
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

@@ -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.4/' "ape-config.yaml" > "ape-config.tmp" && mv "ape-config.tmp" "ape-config.yaml"
fi
- name: Run ape action
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -46,8 +46,8 @@ steps:
- uses: ApeWorX/github-action@v3
with:
python-version: '3.10' # (optional)
ape-version-pin: '>=0.8.10' # (optional)
ape-plugins-list: 'solidity vyper==0.8.4' # (optional)
ape-version-pin: '>=0.8.24' # (optional)
ape-plugins-list: 'solidity vyper==0.8.8' # (optional)
- run: ape test -s
```
25 changes: 14 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion ape-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file exists only as a test for the action.
plugins:
- name: tokens
version: 0.8.0
version: 0.8.4