diff --git a/.github/workflows/publish.yml b/.github/workflows/build-test-publish.yml similarity index 81% rename from .github/workflows/publish.yml rename to .github/workflows/build-test-publish.yml index 9dcd8aa..2110ec7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -1,4 +1,4 @@ -name: Publish +name: Build, test and publish on: workflow_call: @@ -8,10 +8,6 @@ on: type: string jobs: - build-test: - uses: brombal/sqltags/.github/workflows/build-and-test.yml@workflow-test - secrets: inherit - publish: needs: build-test runs-on: ubuntu-latest @@ -24,6 +20,12 @@ jobs: - name: Build run: npm run build + - name: Run Docker test containers + run: docker compose up mysql pg -d + + - name: Run Tests + run: npm test + - name: Publish run: cd ./${{ inputs.package }} && npm publish env: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-test.yml similarity index 62% rename from .github/workflows/build-and-test.yml rename to .github/workflows/build-test.yml index 6bf022d..81989f4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-test.yml @@ -1,6 +1,8 @@ -name: Build and Test +name: Build and test -on: [push, workflow_call] +on: + push: + branches: [*] jobs: build-and-test: @@ -15,13 +17,6 @@ jobs: - name: Build run: npm run build - - name: Upload Build - uses: actions/upload-artifact@v3 - with: - name: build - path: . - retention-days: 1 - - name: Run Docker test containers run: docker compose up mysql pg -d diff --git a/.github/workflows/publish-core.yml b/.github/workflows/publish-core.yml index fafe3e4..c8b398b 100644 --- a/.github/workflows/publish-core.yml +++ b/.github/workflows/publish-core.yml @@ -2,12 +2,11 @@ name: Publish Core on: push: - tags: - - 'core-v*' + tags: ['core-v*'] jobs: publish: - uses: brombal/sqltags/.github/workflows/publish.yml@workflow-test + uses: brombal/sqltags/.github/workflows/build-test-publish.yml@workflow-test secrets: inherit with: package: core \ No newline at end of file diff --git a/.github/workflows/publish-mysql.yml b/.github/workflows/publish-mysql.yml index 4d47eb1..c889bb9 100644 --- a/.github/workflows/publish-mysql.yml +++ b/.github/workflows/publish-mysql.yml @@ -2,12 +2,11 @@ name: Publish MySQL on: push: - tags: - - 'mysql-v*' + tags: ['mysql-v*'] jobs: publish: - uses: brombal/sqltags/.github/workflows/publish.yml@workflow-test + uses: brombal/sqltags/.github/workflows/build-test-publish.yml@workflow-test secrets: inherit with: package: drivers/mysql \ No newline at end of file