From cb039d721de3f4585558c5e9e6136819e28c6346 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 17 Jan 2023 19:24:09 +0200 Subject: [PATCH 1/3] Run tests as part of build --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7707489..12eeca2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,7 +64,7 @@ jobs: - run: mkdir ~/.cargo-registry - name: Build - run: docker run --rm -v ~/.cargo-registry:/usr/local/cargo/registry -v $PWD:/code localhost:5000/phpv8js-build:latest bash -c 'rustup target add ${{ matrix.target }} ; cargo build --release --target ${{ matrix.target }}' + run: docker run --rm -v ~/.cargo-registry:/usr/local/cargo/registry -v $PWD:/code localhost:5000/phpv8js-build:latest bash -c 'rustup target add ${{ matrix.target }} ; cargo test --target ${{ matrix.target }} && cargo build --release --target ${{ matrix.target }}' - name: Rename file run: cp target/${{ matrix.target }}/release/libv8js.so php${{ matrix.php-version }}-${{ matrix.target }}-libv8js.so @@ -118,6 +118,14 @@ jobs: override: true - name: Setup PHP version run: brew install php@${{ matrix.php-version }} && brew unlink php && brew link --force php@${{ matrix.php-version }} + + - name: Test + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.cross }} + command: test + args: --target ${{ matrix.target }} + - name: Build uses: actions-rs/cargo@v1 with: From faff0577a52b30d1c16aaeb3d68ced379fd40a12 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 17 Jan 2023 19:29:06 +0200 Subject: [PATCH 2/3] Pass `--lib` to test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12eeca2..d278d36 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,7 +124,7 @@ jobs: with: use-cross: ${{ matrix.cross }} command: test - args: --target ${{ matrix.target }} + args: --target ${{ matrix.target }} --lib - name: Build uses: actions-rs/cargo@v1 From 3342673bcfa989d73627c1e402fbca841e34a988 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 17 Jan 2023 19:41:49 +0200 Subject: [PATCH 3/3] Remove testing on macos for now --- .github/workflows/build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d278d36..ed999e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,17 +119,9 @@ jobs: - name: Setup PHP version run: brew install php@${{ matrix.php-version }} && brew unlink php && brew link --force php@${{ matrix.php-version }} - - name: Test - uses: actions-rs/cargo@v1 - with: - use-cross: ${{ matrix.cross }} - command: test - args: --target ${{ matrix.target }} --lib - - name: Build uses: actions-rs/cargo@v1 with: - use-cross: ${{ matrix.cross }} command: build args: --release --target ${{ matrix.target }} --lib