diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 967ee19..a14fdb6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,6 @@ on: - published jobs: - build: strategy: matrix: @@ -42,12 +41,14 @@ jobs: run: npm ci --ignore-scripts - name: Build artifact (ia32) - # if: matrix.os != 'macos-latest' run: npm run build --target_arch=ia32 - name: Build artifact (x64) run: npm run build --target_arch=x64 + - name: Run tests + run: npm run test + - name: Upload to release if: steps.get_version.outputs.is-semver == 'true' uses: csexton/release-asset-action@v2 @@ -85,12 +86,13 @@ jobs: install: | apt-get update -y apt-get install -y curl - curl -fsSL https://deb.nodesource.com/setup_12.x | bash - + curl -fsSL https://deb.nodesource.com/setup_10.x | bash - apt-get install -y make g++ python nodejs run: | cd /repo npm ci --ignore-scripts npm run build + npm run test - name: Upload to release if: steps.get_version.outputs.is-semver == 'true' @@ -100,77 +102,8 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} release-url: ${{ github.event.release.upload_url }} - test: - needs: build - strategy: - matrix: - node-version: [10, 12, 14, 16, 17] - os: [ubuntu-latest, macos-latest, windows-latest] - architecture: [x64] - include: - - os: windows-latest - node-version: 16 - architecture: x86 - - name: test ${{ matrix.os }}:${{ matrix.architecture }} (node v${{ matrix.node-version }}) - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup node.js - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - architecture: ${{ matrix.architecture }} - - - id: get_version - name: Extract semver - uses: battila7/get-version-action@v2 - - - name: Set package version - run: npm --no-git-tag-version version ${{ steps.get_version.outputs.version-without-v }} - - - name: Install dependencies & artifact - run: npm ci - - - name: Run tests - run: npm test - - test-arm: - needs: build-arm - strategy: - fail-fast: false - matrix: - node-version: [10, 16] - - name: test arm (node v${{ matrix.node-version }}) - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - id: get_version - name: Extract semver - uses: battila7/get-version-action@v2 - - - name: Set package version - run: npm --no-git-tag-version version ${{ steps.get_version.outputs.version-without-v }} - - - name: Set up qemu - uses: docker/setup-qemu-action@v1 - - - name: Set up docker buildx - uses: docker/setup-buildx-action@v1 - - - name: Install & run tests in docker - run: | - docker buildx build --build-arg NODE_VERSION=${{ matrix.node-version }} --platform linux/arm,linux/arm64 -t armbuild:latest --progress=plain . - publish: - needs: [test, test-arm] + needs: [build, build-arm] runs-on: ubuntu-latest steps: @@ -191,7 +124,10 @@ jobs: run: npm --no-git-tag-version version ${{ steps.get_version.outputs.version-without-v }} - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + + - name: Run tests + run: npm test - name: Build source files run: npm run tsc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0e68c3..9e46e42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,11 +3,6 @@ name: test on: push: branches: [main] - paths-ignore: - - 'README.md' - - 'LICENSE.md' - - '.github/workflows/publish.yml' - - '.github/dependabot.yml' pull_request: branches: [main]