diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 98% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index 4ef5fc35d..2f33cd50e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: CI +name: Build on: push: @@ -9,7 +9,7 @@ on: - main jobs: - build-and-test: + test-and-build: runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..a5af3a476 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Test + +on: + push: + branches: + pull_request: + branches: + +jobs: + test: + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + with: + path: ${{ env.cache_dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install dependencies + run: | + composer install --no-dev --no-interaction --no-scripts + + - name: Run PHPUnit tests + run: | + composer install --no-interaction --no-scripts + ./scripts/test/unit.sh + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.22 + cache-dependency-path: cli/go.sum + + - name: Run integration tests + run: | + export TEST_CLI_PATH=$(realpath "./bin/platform") + cd go-tests + go test ./... -v