From bf74e30ca84b9ab2d7523658102fa9b9edf336dc Mon Sep 17 00:00:00 2001 From: dskvr Date: Sun, 15 Sep 2024 11:42:33 +0200 Subject: [PATCH] fix workflows --- .github/workflows/build.yaml | 28 +++++++++++++++++----------- .github/workflows/coverage.yaml | 24 ++++++++++++++++++++++++ .github/workflows/test.yaml | 22 ++++++++++++---------- 3 files changed, 53 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ad21645..17ae4c4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Deploy Demo to GitHub Pages +name: build on: push: @@ -19,24 +19,24 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Repository + - name: checkout uses: actions/checkout@v3 - - name: Delete demo/pkg symlink + - name: delete symlink run: rm -fr demo/pkg - - name: Setup Rust Toolchain - uses: actions-rust-lang/setup-rust@v1 + - name: setup rust + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable target: wasm32-unknown-unknown - - name: Install wasm-pack + - name: install build wasm-pack uses: qmaru/wasm-pack-action@v0.5.0 with: - version: '0.11.1' + version: 'latest' - - name: Build Rust Miner + - name: build wasm run: | bash ./scripts/build-notemine-wasm.sh @@ -45,8 +45,14 @@ jobs: # with: # node-version: '20' - - name: Install Dependencies + - name: install run: yarn install - - name: Build with Webpack - run: yarn build \ No newline at end of file + - name: webpack + run: yarn build + + - name: uplooad artifact + uses: actions/upload-artifact@v3 + with: + name: notemine-build + path: ./ \ No newline at end of file diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index e69de29..cfc3ac7 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,24 @@ + +name: coverage +on: + workflow_dispatch: + workflow_run: + workflows: ["docs"] + branches: ["main"] + types: + - completed +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Install + run: yarn install + - name: Test and Coverage + run: yarn coverage + - name: Update Coverage Badge + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + uses: we-cli/coverage-badge-action@main \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3e115b5..11ae300 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,9 +1,14 @@ -name: Deploy Demo to GitHub Pages +name: test on: push: branches: ["master"] workflow_dispatch: + workflow_run: + workflows: + - build + types: + - completed permissions: contents: read @@ -19,14 +24,11 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 + - name: download artifact + uses: actions/download-artifact@v3 + with: + name: notemine-build + path: ./ - - name: Install - run: yarn install - - - name: Webpack - run: yarn build - - - name: Vitest + - name: vitest run: yarn test \ No newline at end of file