From 050d739f7c77279f7dc101ac6bb1dc45aab9f724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=BCster?= Date: Wed, 17 Jul 2024 21:55:08 +0200 Subject: [PATCH] ci: add github actions based tests (#93) --- .github/workflows/tests.yml | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ac2f576 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,69 @@ +# the test suite runs the tests (headless, server+client) for multiple Meteor releases +name: Test suite +on: + push: + branches: + - master + pull_request: + +jobs: + lint: + name: Javascript standard lint + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: setup node + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-20-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-20- + + - run: | + npm ci + npm run lint + + test: + name: Meteor package tests + # needs: [lint] + runs-on: ubuntu-latest + strategy: + matrix: + meteorRelease: + - '3.0.1' + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Setup meteor ${{ matrix.meteorRelease }} + uses: meteorengineer/setup-meteor@v1 + with: + meteor-release: ${{ matrix.meteorRelease }} + + - name: cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-20-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-20- + + - name: Install test dependencies + run: npm ci + + + - name: Run tests + run: meteor npm run test