From 0aa469e1f3784ca4376eced4a5f4ea9507573ca2 Mon Sep 17 00:00:00 2001 From: Alessandro Rabitti Date: Wed, 2 Oct 2024 18:03:59 +0200 Subject: [PATCH 1/2] Added test --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a1f5dea --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,11 @@ +name: Test variables + +on: push + +jobs: + build: + name: Get variables + runs-on: ubuntu-latest + steps: + - name: Print name + run: echo "Hello the NEXT_MONGO_DB_URL is ${{secrets.NEXT_MONGO_DB_URL}}" From 413b09ec21e0901b2c4ae3e08fd3d1794bdc28b6 Mon Sep 17 00:00:00 2001 From: Alessandro Rabitti Date: Wed, 2 Oct 2024 18:23:35 +0200 Subject: [PATCH 2/2] Added --- .github/workflows/deployment.yml | 28 --------------------- .github/workflows/playwright.yml | 43 -------------------------------- .github/workflows/test.yml | 21 +++++++++++++--- 3 files changed, 18 insertions(+), 74 deletions(-) delete mode 100644 .github/workflows/deployment.yml delete mode 100644 .github/workflows/playwright.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml deleted file mode 100644 index 00350de..0000000 --- a/.github/workflows/deployment.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Node checks - -on: push - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20.10.x] - - steps: - - uses: actions/checkout@v4 - - name: Use Node ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - - name: CI command - run: npm ci - - - name: Linting checks - run: npm run lint - - - name: Unit Tests - run: npm run test:unit diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index 9a28a5d..0000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: E2e tests - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - test: - runs-on: ubuntu-latest - - timeout-minutes: 60 - - steps: - - name: Wait for HTTP Status Code 200 from the Vercel Preview Deploy - uses: patrickedqvist/wait-for-vercel-preview@v1.3.2 - id: waitForVercelPreviewDeploy - with: - token: ${{ secrets.GITHUB_TOKEN }} - max_timeout: 300 - - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install dependencies - run: npm ci - - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - - name: Run Playwright tests - env: - PLAYWRIGHT_BASE_URL: ${{ steps.waitForVercelPreviewDeploy.outputs.url }} - run: npx playwright test - - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1f5dea..f4e9654 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,11 +1,26 @@ name: Test variables -on: push +on: pull_request jobs: build: name: Get variables runs-on: ubuntu-latest + + environment: + name: preview + steps: - - name: Print name - run: echo "Hello the NEXT_MONGO_DB_URL is ${{secrets.NEXT_MONGO_DB_URL}}" + - name: Print secrets + env: + NEXT_MONGO_DB_URL: ${{ secrets.NEXT_MONGO_DB_URL }} + run: + echo "Hello the NEXT_MONGO_DB_URL is $NEXT_MONGO_DB_URL" + echo "Hello the TEST_MONGO_DB_URL is ${{ secrets.TEST_MONGO_DB_URL }}" + + - name: Print variables + env: + NEXT_PUBLIC_NODE_ENV: ${{ vars.NEXT_PUBLIC_NODE_ENV }} + run: + echo "Hello the NEXT_PUBLIC_NODE_ENV is $NEXT_PUBLIC_NODE_ENV" + echo "Hello the TEST_PUBLIC_NODE_ENV is ${{ vars.TEST_PUBLIC_NODE_ENV }}"