From 63d7bff0b99095638ac20652af8f9e64881b3161 Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 09:07:04 -0400 Subject: [PATCH 1/9] use nix in github action --- .github/workflows/rust.yml | 24 +++++++----------------- app/flake.nix | 1 + 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 969f3d121..f7e714ec6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,31 +16,21 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: cachix/install-nix-action@v22 with: - node-version: 18 + github_access_token: ${{ secrets.GITHUB_TOKEN }} - name: Build working-directory: app/ - run: | - cargo build - cargo install trunk + run: nix-shell --run "cargo build" - name: Run tests working-directory: app/ - run: cargo test --verbose + run: nix-shell --run "cargo test" - name: Npm install working-directory: app/ - run: npm install + run: nix-shell --run "npm install" - name: Install playwright deps working-directory: app/ - run: npx playwright install --with-deps + run: nix-shell --run "npx playwright install --with-deps" - name: Run playwright tests working-directory: app/ - run: | - rustup target add wasm32-unknown-unknown - npx playwright test - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 \ No newline at end of file + run: nix-shell --run "npx playwright test" \ No newline at end of file diff --git a/app/flake.nix b/app/flake.nix index 262d3da04..fca404db0 100644 --- a/app/flake.nix +++ b/app/flake.nix @@ -28,6 +28,7 @@ cacert cargo-make trunk + nodejs_18 (rust-bin.selectLatestNightlyWith( toolchain: toolchain.default.override { extensions= [ "rust-src" "rust-analyzer" ]; targets = [ "wasm32-unknown-unknown" ]; From ec6ee94b807b652c3679ce39096cf24cd1f92275 Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 09:20:41 -0400 Subject: [PATCH 2/9] consolidate playwright steps into one --- .github/workflows/rust.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f7e714ec6..bea9022ca 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -28,9 +28,6 @@ jobs: - name: Npm install working-directory: app/ run: nix-shell --run "npm install" - - name: Install playwright deps + - name: Install playwright deps and run tests working-directory: app/ - run: nix-shell --run "npx playwright install --with-deps" - - name: Run playwright tests - working-directory: app/ - run: nix-shell --run "npx playwright test" \ No newline at end of file + run: nix-shell --run "npx playwright install --with-deps && npx playwright test" \ No newline at end of file From d675d21ec7199056e765c814e771c1abcce334a5 Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 09:30:05 -0400 Subject: [PATCH 3/9] include nix path in github action --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bea9022ca..75a9bf4f3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,6 +19,7 @@ jobs: - uses: cachix/install-nix-action@v22 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} + nix_path: nixpkgs=channel:nixos-unstable - name: Build working-directory: app/ run: nix-shell --run "cargo build" From e88465df76b2f94867577d5eebe30554284b921b Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 09:50:29 -0400 Subject: [PATCH 4/9] see if node installed properly --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 75a9bf4f3..72d479e94 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -28,7 +28,7 @@ jobs: run: nix-shell --run "cargo test" - name: Npm install working-directory: app/ - run: nix-shell --run "npm install" + run: nix-shell --run "npm ci" - name: Install playwright deps and run tests working-directory: app/ - run: nix-shell --run "npx playwright install --with-deps && npx playwright test" \ No newline at end of file + run: nix-shell --run "node --version && npx playwright install --with-deps && npx playwright test" \ No newline at end of file From b8d3f3372400b97dad4ad152e0ac62c3af21488c Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 09:52:52 -0400 Subject: [PATCH 5/9] see if node installed properly --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 72d479e94..eb5c328e7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,7 +22,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - name: Build working-directory: app/ - run: nix-shell --run "cargo build" + run: nix-shell --run "node --version && cargo build" - name: Run tests working-directory: app/ run: nix-shell --run "cargo test" From 215719244db5c5116df548e4b27cc959d32673ee Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 09:53:34 -0400 Subject: [PATCH 6/9] swithc back to npm install --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index eb5c328e7..d558f3ba3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -28,7 +28,7 @@ jobs: run: nix-shell --run "cargo test" - name: Npm install working-directory: app/ - run: nix-shell --run "npm ci" + run: nix-shell --run "npm install" - name: Install playwright deps and run tests working-directory: app/ run: nix-shell --run "node --version && npx playwright install --with-deps && npx playwright test" \ No newline at end of file From 3499eb1be1921fab0e1f7d5ffc3b8fb9adb826e9 Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 10:00:46 -0400 Subject: [PATCH 7/9] use npx playwright install-deps --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d558f3ba3..90d2e8e0c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,4 +31,4 @@ jobs: run: nix-shell --run "npm install" - name: Install playwright deps and run tests working-directory: app/ - run: nix-shell --run "node --version && npx playwright install --with-deps && npx playwright test" \ No newline at end of file + run: nix-shell --run "node --version && npx playwright install-deps && npx playwright test" \ No newline at end of file From 21a33f9d1824171752f98e38264d07d24bd3c3b6 Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 10:05:43 -0400 Subject: [PATCH 8/9] add missing npx playwright install --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 90d2e8e0c..9488a47bb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,4 +31,4 @@ jobs: run: nix-shell --run "npm install" - name: Install playwright deps and run tests working-directory: app/ - run: nix-shell --run "node --version && npx playwright install-deps && npx playwright test" \ No newline at end of file + run: nix-shell --run "node --version && npx playwright install-deps && npx playwright install && npx playwright test" \ No newline at end of file From cb17aca843a5886a2010c7bf3cdf6ddc8afa7de7 Mon Sep 17 00:00:00 2001 From: Nathan Tranquilla Date: Wed, 6 Dec 2023 10:08:42 -0400 Subject: [PATCH 9/9] swithc to macos-12 Monterey --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9488a47bb..f4516d1b6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,7 +12,7 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: macos-12 steps: - uses: actions/checkout@v3 @@ -31,4 +31,4 @@ jobs: run: nix-shell --run "npm install" - name: Install playwright deps and run tests working-directory: app/ - run: nix-shell --run "node --version && npx playwright install-deps && npx playwright install && npx playwright test" \ No newline at end of file + run: nix-shell --run "node --version && npx playwright install --with-deps && npx playwright test" \ No newline at end of file