From 39cfaba7f63491d4022b7593b9956b2aca68e2ed Mon Sep 17 00:00:00 2001 From: sarisia Date: Sat, 7 Oct 2023 21:34:02 +0000 Subject: [PATCH] only run unit on ci --- .github/workflows/test-and-run.yml | 102 ----------------------------- .github/workflows/test.yml | 37 +++++++++++ 2 files changed, 37 insertions(+), 102 deletions(-) delete mode 100644 .github/workflows/test-and-run.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test-and-run.yml b/.github/workflows/test-and-run.yml deleted file mode 100644 index cb3a9ce0..00000000 --- a/.github/workflows/test-and-run.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: "test" -on: - workflow_dispatch: - push: - pull_request: - merge_group: - -jobs: - test-unit: - runs-on: ubuntu-latest - permissions: - packages: read - contents: read - steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - - name: build - uses: devcontainers/ci@57eaf0c9b518a76872bc429cdceefd65a912309b - with: - imageName: ghcr.io/${{ github.repository }}/devcontainer - cacheFrom: ghcr.io/${{ github.repository }}/devcontainer - push: never - runCmd: | - npm ci - npm test - - test-run: - runs-on: ubuntu-latest - permissions: - packages: read - contents: read - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - - name: build - uses: devcontainers/ci@57eaf0c9b518a76872bc429cdceefd65a912309b - with: - imageName: ghcr.io/${{ github.repository }}/devcontainer - cacheFrom: ghcr.io/${{ github.repository }}/devcontainer - push: never - runCmd: | - npm ci - npm run build - - - name: run-1 (send real Discord message!) - uses: ./ - with: - content: "hey <@316911818725392384>" - title: "Test running" - description: "testing commit `${{ github.sha }}`" - nofail: false - image: "https://user-images.githubusercontent.com/33576079/81886735-69e03f80-95d8-11ea-8828-fa10dda8afd1.png" - color: 0xFFFFFF - username: GitHub Actions - - - name: run-2 (send real Discord message!) - # do not reference as local action! (runs: ./) - uses: ./ - with: - nofail: false - - - name: run-3 (send real Discord message!) - uses: ./ - with: - status: Cancelled - title: "test no details" - nodetail: true - nofail: false - - conclude: - runs-on: ubuntu-latest - needs: - - test-unit - - test-run - if: always() - permissions: - actions: read - steps: - - uses: sarisia/actions/conclusion@main - id: ghapi - - - name: report result - uses: sarisia/actions-status-discord@82409b24a08684f54ea5baa6b376e36dad37fb81 - if: always() - with: - webhook: ${{ secrets.DISCORD_WEBHOOK }} - status: ${{ steps.ghapi.outputs.conclusion }} - title: ${{ github.workflow }} - conclusion diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..0c1a57b7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: "test" +on: + workflow_dispatch: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + permissions: + packages: read + contents: read + steps: + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + + - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: build + uses: devcontainers/ci@57eaf0c9b518a76872bc429cdceefd65a912309b + with: + imageName: ghcr.io/${{ github.repository }}/devcontainer + cacheFrom: ghcr.io/${{ github.repository }}/devcontainer + push: never + runCmd: | + npm ci + npm test + npm run build + + - name: report result + uses: sarisia/actions-status-discord@82409b24a08684f54ea5baa6b376e36dad37fb81 + if: always() + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }}