From 3279a58ec3a77e2c9533e12de92c8e0c35acd9b4 Mon Sep 17 00:00:00 2001 From: Fu Zi Xiang Date: Sat, 14 Oct 2023 10:58:35 +0800 Subject: [PATCH 1/4] feat: added github actions --- .github/workflows/integrations.yml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/integrations.yml diff --git a/.github/workflows/integrations.yml b/.github/workflows/integrations.yml new file mode 100644 index 0000000..916d9b9 --- /dev/null +++ b/.github/workflows/integrations.yml @@ -0,0 +1,39 @@ +name: Integration Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + services: + mysql: + image: mysql + env: + MYSQL_ROOT_PASSWORD: password + ports: + - 3306/tcp + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - uses: actions/checkout@v3 + + - name: install zig + run: | + curl https://ziglang.org/download/ > page.xml + ZIG_VERSION=$(cat page.xml | tidy -html 2> /dev/null | grep zig-linux-x86_64 | head -n 1 | cut -d '-' -f 4,5 | cut -d '.' -f 1,2,3,4) + echo "zig version: $ZIG_VERSION" + wget https://ziglang.org/builds/zig-linux-x86_64-$ZIG_VERSION.tar.xz + tar xf zig-linux-x86_64-$ZIG_VERSION.tar.xz + mv zig-linux-x86_64-$ZIG_VERSION ~/zig-build + export PATH=~/zig-build:$PATH + + - name: run the tests + run: | + zig test src/myzql.zig From aa0389c64ee8575a7a3f7904b1c93c1a0cb8c6df Mon Sep 17 00:00:00 2001 From: Fu Zi Xiang Date: Sat, 14 Oct 2023 11:04:21 +0800 Subject: [PATCH 2/4] fix: try static version --- .github/workflows/integrations.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integrations.yml b/.github/workflows/integrations.yml index 916d9b9..e2b87e8 100644 --- a/.github/workflows/integrations.yml +++ b/.github/workflows/integrations.yml @@ -26,8 +26,9 @@ jobs: - name: install zig run: | - curl https://ziglang.org/download/ > page.xml - ZIG_VERSION=$(cat page.xml | tidy -html 2> /dev/null | grep zig-linux-x86_64 | head -n 1 | cut -d '-' -f 4,5 | cut -d '.' -f 1,2,3,4) + # curl -L https://ziglang.org/download/ > page.xml + # ZIG_VERSION=$(cat page.xml | tidy -html 2> /dev/null | grep zig-linux-x86_64 | head -n 1 | cut -d '-' -f 4,5 | cut -d '.' -f 1,2,3,4) + ZIG_VERSION=0.12.0-dev.897+2769215b9 echo "zig version: $ZIG_VERSION" wget https://ziglang.org/builds/zig-linux-x86_64-$ZIG_VERSION.tar.xz tar xf zig-linux-x86_64-$ZIG_VERSION.tar.xz From d36837b36da5a19ff0e193c8cf89860039669274 Mon Sep 17 00:00:00 2001 From: Fu Zi Xiang Date: Sat, 14 Oct 2023 11:07:38 +0800 Subject: [PATCH 3/4] fix: try fix ci - 1 --- .github/workflows/integrations.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integrations.yml b/.github/workflows/integrations.yml index e2b87e8..7487cec 100644 --- a/.github/workflows/integrations.yml +++ b/.github/workflows/integrations.yml @@ -32,9 +32,8 @@ jobs: echo "zig version: $ZIG_VERSION" wget https://ziglang.org/builds/zig-linux-x86_64-$ZIG_VERSION.tar.xz tar xf zig-linux-x86_64-$ZIG_VERSION.tar.xz - mv zig-linux-x86_64-$ZIG_VERSION ~/zig-build - export PATH=~/zig-build:$PATH + mv zig-linux-x86_64-$ZIG_VERSION $HOME/zig-build - name: run the tests run: | - zig test src/myzql.zig + $HOME/zig-build/zig test src/myzql.zig From 95443602f34ea60f42df0ea800f59a1e338eedb8 Mon Sep 17 00:00:00 2001 From: Zack <33050391+speed2exe@users.noreply.github.com> Date: Sat, 14 Oct 2023 11:59:25 +0800 Subject: [PATCH 4/4] Update integrations.yml --- .github/workflows/integrations.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integrations.yml b/.github/workflows/integrations.yml index 7487cec..48ec30d 100644 --- a/.github/workflows/integrations.yml +++ b/.github/workflows/integrations.yml @@ -11,17 +11,11 @@ on: jobs: build: runs-on: ubuntu-latest - - services: - mysql: - image: mysql - env: - MYSQL_ROOT_PASSWORD: password - ports: - - 3306/tcp - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: + - name: run mysql server + run: | + docker run --name some-mysql --env MYSQL_ALLOW_EMPTY_PASSWORD=1 -p 3306:3306 -d mysql + - uses: actions/checkout@v3 - name: install zig