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

added macos-latest to ci #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SOURCE_WASM_FILE_UBUNTU="WasmRunner/obj/release/net8.0/wasi-wasm/wasm/for-publish/WasmRunner.wasm"
SOURCE_WASM_FILE="WasmRunner/bin/Release/net8.0/wasi-wasm/AppBundle/WasmRunner.wasm"
SOURCE_WASM_FILE_MACOS="WasmRunner/bin/Release/net8.0/wasi-wasm/AppBundle/WasmRunner.wasm"
TESTS_CONTAINER_NAME="plugin-tests"
MYSQL_CONNECTION_STRING="server=mysqldb;database=tests;user=root"
POSTGRES_CONNECTION_STRING="host=postgresdb;database=tests;username=user;password=pass"
33 changes: 20 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ jobs:
MySqlConnectorExample
NpgsqlExample


ci:
name: CI
runs-on: ${{ matrix.os }}
if: ${{ always() }}
strategy:
matrix:
os: [ ubuntu-latest ]
architecture: [ "x64", "arm64" ]
os: [ ubuntu-latest, macos-13 ]
Copy link

Choose a reason for hiding this comment

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

@SockworkOrange macos-latest as in the name of the PR is macos-14. Thanks for the great work with this plugin.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah there was something broken docker-related in the macos-14 runner, don't remember what it was anymore:)

architecture: [ "x64" ] # , "arm64"
dotnet-version: [ '8.0.x' ]

steps:
Expand All @@ -62,7 +61,7 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: install Wasi workload
- name: Install Wasi workload
run: dotnet workload install wasi-experimental

- name: Download Wasi SDK on Ubuntu
Expand All @@ -71,6 +70,13 @@ jobs:
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0-linux.tar.gz
tar xf wasi-sdk-22.0-linux.tar.gz
chmod -R 755 wasi-sdk-22.0

- name: Download Wasi SDK on MacOS
if: runner.os == 'macOS'
run: |
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0-macos.tar.gz
tar xf wasi-sdk-22.0-macos.tar.gz
chmod -R 755 wasi-sdk-22.0

# name: Download WASI SDK on Windows
# run: |
Expand Down Expand Up @@ -98,18 +104,19 @@ jobs:

- name: Sqlc generate using Wasm plugin
run: sqlc -f sqlc.wasm.yaml generate

- uses: hoverkraft-tech/[email protected]
with:
services: |
mysqldb
postgresdb
plugin-tests

# - name: Setup Docker support via Colima on MacOS
# if: runner.os == 'macOS'
# run: |
# set -x
# brew install docker docker-compose
# open -a $(which docker)
# sleep 4

- name: Test generated code
run: |
chmod +x ./scripts/run_tests.sh
./scripts/run_tests.sh
docker-compose up -d
./scripts/run_tests.sh

- name: upload wasm plugin as artifact
uses: actions/upload-artifact@v2
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ services:
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: tests
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: "tests"
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
healthcheck:
test: "mysqladmin ping -h 127.0.0.1"
timeout: 20s
Expand Down
7 changes: 4 additions & 3 deletions scripts/wasm/copy_to_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
set -e
source .env

if [ "${GITHUB_ACTIONS}" = "true" ]; then
RUNNER_OS=$(uname -s)
if [ "${RUNNER_OS}" == "Darwin" ]; then
WASM_FILE="${SOURCE_WASM_FILE_MACOS}"
elif [ "${RUNNER_OS}" == "Linux" ]; then
WASM_FILE="${SOURCE_WASM_FILE_UBUNTU}"
else
WASM_FILE="${SOURCE_WASM_FILE}"
fi

echo "WASM_FILE = ${WASM_FILE}"
Expand Down
Loading