From b9fcb92996e0431c3c92f6ce259ef52e9b48f799 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 2 Apr 2024 16:53:36 +0200 Subject: [PATCH 1/6] Run test on Mac M1. Mac OS 14 on GitHub actions uses M1. Setting up matrix that runs both on latest Ubuntu and Mac OS 14. --- .github/workflows/push.yml | 40 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 76cbcc45..1d15ae94 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -11,22 +11,24 @@ on: jobs: build: - name: Lint, test, and run visual regression tests - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - name: Checkout branch - uses: actions/checkout@v3 - - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: 'npm' - - name: Install dependencies - run: npm ci - - name: Run tests - run: npm test - - name: Run visual regression - shell: 'script -q -e -c "bash {0}"' - run: | - script -e -c "./pixel.js reference && ./pixel.js test" + strategy: + matrix: + runs-on: ['ubuntu-latest', 'macos-14'] + name: Lint, test, and run visual regression tests on ${{ matrix.runs-on }} + timeout-minutes: 20 + steps: + - name: Checkout branch + uses: actions/checkout@v3 + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run tests + run: npm test + - name: Run visual regression + shell: 'script -q -e -c "bash {0}"' + run: | + script -e -c "./pixel.js reference && ./pixel.js test" From 1780ee879cdc213522ef8de0c19e50f784f2a508 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 2 Apr 2024 18:38:34 +0200 Subject: [PATCH 2/6] Fix steps --- .github/workflows/push.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 1d15ae94..3368b41e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -17,18 +17,18 @@ jobs: name: Lint, test, and run visual regression tests on ${{ matrix.runs-on }} timeout-minutes: 20 steps: - - name: Checkout branch - uses: actions/checkout@v3 - - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: 'npm' - - name: Install dependencies - run: npm ci - - name: Run tests - run: npm test - - name: Run visual regression - shell: 'script -q -e -c "bash {0}"' - run: | - script -e -c "./pixel.js reference && ./pixel.js test" + - name: Checkout branch + uses: actions/checkout@v3 + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run tests + run: npm test + - name: Run visual regression + shell: 'script -q -e -c "bash {0}"' + run: | + script -e -c "./pixel.js reference && ./pixel.js test" From 8d3fc4ad3dd283022c69eef3d8fee44d1054ade9 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 2 Apr 2024 19:00:31 +0200 Subject: [PATCH 3/6] cleanup --- .github/workflows/push.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 3368b41e..615acf29 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -8,15 +8,15 @@ on: branches: [ main ] pull_request: branches: [ main ] - jobs: build: strategy: matrix: runs-on: ['ubuntu-latest', 'macos-14'] - name: Lint, test, and run visual regression tests on ${{ matrix.runs-on }} - timeout-minutes: 20 - steps: + runs-on: ${{ matrix.os }} + name: Lint, test, and run visual regression tests on ${{ matrix.runs-on }} + timeout-minutes: 20 + steps: - name: Checkout branch uses: actions/checkout@v3 - name: Setup Node.js ${{ matrix.node-version }} From ba23aa7f23721d77201cd04ffee2dc31be78057b Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 2 Apr 2024 19:03:18 +0200 Subject: [PATCH 4/6] more fixes --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 615acf29..b6f41c56 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -14,7 +14,7 @@ jobs: matrix: runs-on: ['ubuntu-latest', 'macos-14'] runs-on: ${{ matrix.os }} - name: Lint, test, and run visual regression tests on ${{ matrix.runs-on }} + name: Lint, test, and run visual regression tests on ${{ matrix.os }} timeout-minutes: 20 steps: - name: Checkout branch From 016de71524e7127bd448a3a91d3cd869353d2394 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 2 Apr 2024 19:09:47 +0200 Subject: [PATCH 5/6] correct matrix name --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b6f41c56..c15a54c0 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -12,7 +12,7 @@ jobs: build: strategy: matrix: - runs-on: ['ubuntu-latest', 'macos-14'] + os: ['ubuntu-latest', 'macos-14'] runs-on: ${{ matrix.os }} name: Lint, test, and run visual regression tests on ${{ matrix.os }} timeout-minutes: 20 From f8dfb9b4a7a8033ca8f56269e233ef0e3564f180 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 2 Apr 2024 19:14:34 +0200 Subject: [PATCH 6/6] Simplify running --- .github/workflows/push.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c15a54c0..a64a5446 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -29,6 +29,7 @@ jobs: - name: Run tests run: npm test - name: Run visual regression - shell: 'script -q -e -c "bash {0}"' run: | - script -e -c "./pixel.js reference && ./pixel.js test" + ./pixel.js reference + ./pixel.js test + shell: bash