From bec4072837a0b87a503f8ef8238522288b15d812 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 14 Apr 2024 15:58:00 -0400 Subject: [PATCH] Merge test actions into one action --- .gitea/workflows/DRBv3_tests.yaml | 72 +++++++++++++++++++ ...lient_tests.yaml => client_tests.yaml.BAK} | 0 ...erver_tests.yaml => server_tests.yaml.BAK} | 0 3 files changed, 72 insertions(+) create mode 100644 .gitea/workflows/DRBv3_tests.yaml rename .gitea/workflows/{client_tests.yaml => client_tests.yaml.BAK} (100%) rename .gitea/workflows/{server_tests.yaml => server_tests.yaml.BAK} (100%) diff --git a/.gitea/workflows/DRBv3_tests.yaml b/.gitea/workflows/DRBv3_tests.yaml new file mode 100644 index 0000000..cf86540 --- /dev/null +++ b/.gitea/workflows/DRBv3_tests.yaml @@ -0,0 +1,72 @@ +name: Run Discord Radio Bot v3 Tests + +on: [push, pull_request] + +env: + NODE_ENV: development + MONGO_INITDB_ROOT_USERNAME: admin + MONGO_INITDB_ROOT_PASSWORD: admin + MONGO_INITDB_DATABASE: drb + SERVER_PORT: 6000 + MONGO_URL: "mongodb://mongodb:27017/drb" + DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }} + TEST_CHANNEL_ID: ${{ secrets.TEST_CHANNEL_ID }} + TEST_GUILD_ID: ${{ secrets.TEST_GUILD_ID }} + EXPECTED_CLIENT_ID: ${{ secrets.EXPECTED_CLIENT_ID }} + PDAB_PORT: ${{ secrets.PDAB_PORT }} + +jobs: + test: + runs-on: ubuntu-latest + + services: + mongodb: + image: mongo:latest + ports: + - 27017:27017 + options: >- + --health-cmd mongo + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Remove package-lock.json (Server) + working-directory: "./server" + run: rm package-lock.json + + - name: Install Node-GYP (Server) + working-directory: "./server" + run: npm install -g node-gyp + + - name: Install dependencies (Server) + working-directory: "./server" + run: npm install + + - name: Remove package-lock.json (Client) + working-directory: "./client" + run: rm package-lock.json + + - name: Install dependencies (Client) + working-directory: "./client" + run: npm install + + - run: echo "Node has finished installing dependencies" + + - name: Run Server tests + working-directory: "./server" + run: npm test + + - name: Run Client tests + working-directory: "./client" + run: npm test + + - run: echo "Completed the tests" diff --git a/.gitea/workflows/client_tests.yaml b/.gitea/workflows/client_tests.yaml.BAK similarity index 100% rename from .gitea/workflows/client_tests.yaml rename to .gitea/workflows/client_tests.yaml.BAK diff --git a/.gitea/workflows/server_tests.yaml b/.gitea/workflows/server_tests.yaml.BAK similarity index 100% rename from .gitea/workflows/server_tests.yaml rename to .gitea/workflows/server_tests.yaml.BAK