From d12204e3a8dcdf50e52f3a89f1b4c180db87670c Mon Sep 17 00:00:00 2001 From: Charis Lam <26616127+charislam@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:40:45 -0500 Subject: [PATCH] ci: run smoke tests to check published packages work --- .github/workflows/smoke-test.yml | 123 +++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 .github/workflows/smoke-test.yml diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml new file mode 100644 index 0000000..97ada9b --- /dev/null +++ b/.github/workflows/smoke-test.yml @@ -0,0 +1,123 @@ +name: smoke-test + +on: + schedule: + - cron: "23 1 * * *" + workflow_dispatch: + +jobs: + test-ubuntu: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18, 20, 22] + + steps: + - name: Set up Node + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: ${{ matrix.node-version }} + - name: Create test directory + run: mkdir test + - name: Create package.json + working-directory: test + run: | + cat < package.json + { + "name": "test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "lint": "supa-mdx-lint --version" + }, + "keywords": [], + "author": "", + "license": "ISC" + } + EOF + - name: Install supa-mdx-lint + working-directory: test + run: npm install @supabase/supa-mdx-lint + - name: Test linter + working-directory: test + run: npm run lint + + test-macos: + runs-on: macos-latest + + strategy: + matrix: + node-version: [18, 20, 22] + + steps: + - name: Set up Node + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: ${{ matrix.node-version }} + - name: Create test directory + run: mkdir test + - name: Create package.json + working-directory: test + run: | + cat < package.json + { + "name": "test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "lint": "supa-mdx-lint --version" + }, + "keywords": [], + "author": "", + "license": "ISC" + } + EOF + - name: Install supa-mdx-lint + working-directory: test + run: npm install @supabase/supa-mdx-lint + - name: Test linter + working-directory: test + run: npm run lint + + test-windows: + runs-on: windows-latest + + strategy: + matrix: + node-version: [18, 20, 22] + + steps: + - name: Set up Node + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: ${{ matrix.node-version }} + - name: Create test directory + run: mkdir test + - name: Create package.json + shell: pwsh + working-directory: test + run: | + $json = @" + { + "name": "test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "lint": "supa-mdx-lint --version" + }, + "keywords": [], + "author": "", + "license": "ISC" + } + "@ + $json | Out-File -FilePath package.json -Encoding utf8 + - name: Install supa-mdx-lint + working-directory: test + run: npm install @supabase/supa-mdx-lint + - name: Test linter + working-directory: test + run: npm run lint