From 74c63aaeb2042ff494aafd355ed4f7a0f2e8cae0 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 24 Oct 2024 21:13:00 -0400 Subject: [PATCH] Remove deno tests, consolidate web validator build/deploy --- .github/workflows/deno_tests.yml | 99 ------------------- .github/workflows/schema_web_build.yml | 28 ------ ...chema_web_deploy.yml => web_validator.yml} | 23 ++--- 3 files changed, 10 insertions(+), 140 deletions(-) delete mode 100644 .github/workflows/deno_tests.yml delete mode 100644 .github/workflows/schema_web_build.yml rename .github/workflows/{schema_web_deploy.yml => web_validator.yml} (61%) diff --git a/.github/workflows/deno_tests.yml b/.github/workflows/deno_tests.yml deleted file mode 100644 index 0dc8eea91..000000000 --- a/.github/workflows/deno_tests.yml +++ /dev/null @@ -1,99 +0,0 @@ ---- -name: Deno build - -on: - push: - branches: [master] - tags: ['*'] - pull_request: - branches: [master] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Save describe stamp - id: describe - run: echo version=$( git describe ) >> $GITHUB_OUTPUT - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - run: ./build.ts - working-directory: ./bids-validator - - run: deno run -A ./bids-validator/dist/validator/bids-validator.js --version - - uses: actions/upload-artifact@v4 - with: - name: main - path: bids-validator/dist/validator - - test: - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - strategy: - matrix: - os: [ubuntu-22.04, macos-12, windows-2022] - allow-net: [true, false] - fail-fast: false - defaults: - run: - working-directory: ./bids-validator - shell: bash - - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - name: Set permissions with network access - run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --allow-net' >> $GITHUB_ENV - if: ${{ matrix.allow-net }} - - name: Set permissions without network access - run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --deny-net' >> $GITHUB_ENV - if: ${{ ! matrix.allow-net }} - - run: deno test $PERMS --coverage=cov/ src/ - - name: Collect coverage - run: deno coverage cov/ --lcov --output=coverage.lcov - if: ${{ always() }} - - uses: codecov/codecov-action@v4 - if: ${{ always() }} - with: - files: coverage.lcov - - deploy: - needs: [build] - runs-on: ubuntu-latest - if: github.event_name != 'pull_request' && github.repository_owner == 'bids-standard' - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.PUSH_TOKEN }} - - name: Set credentials - run: | - git config --global user.name "BIDS-Bot" - git config --global user.email "bids-maintenance@users.noreply.github.com" - - name: Reset deno-build to orphan - run: | - git checkout --orphan deno-build - git reset --hard - - uses: actions/download-artifact@v4 - with: - name: main - path: main - - name: Commit to new branch - run: | - mv main/main.js main/bids-validator.js . - git add main.js bids-validator.js - git commit -m "BLD: $VERSION [skip ci]" || true - env: - VERSION: ${{ needs.build.describe.version }} - - name: Push - run: git push -f origin deno-build diff --git a/.github/workflows/schema_web_build.yml b/.github/workflows/schema_web_build.yml deleted file mode 100644 index 97f340216..000000000 --- a/.github/workflows/schema_web_build.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Schema validator web build - -on: - push: - branches: [master] - tags: ['*'] - pull_request: - branches: [master] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - run: deno task build - working-directory: ./web - - uses: actions/upload-artifact@v4 - with: - name: web - path: web/dist diff --git a/.github/workflows/schema_web_deploy.yml b/.github/workflows/web_validator.yml similarity index 61% rename from .github/workflows/schema_web_deploy.yml rename to .github/workflows/web_validator.yml index 2778bf4e5..3d81e240a 100644 --- a/.github/workflows/schema_web_deploy.yml +++ b/.github/workflows/web_validator.yml @@ -1,7 +1,11 @@ --- -name: Schema validator web deploy +name: Web validator build and deploy on: + push: + branches: [master, main] + pull_request: + branches: [master, main] release: types: [published] @@ -11,41 +15,34 @@ concurrency: jobs: build: + name: Build web validator runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - # Use Node 18 for legacy build - uses: actions/setup-node@v4 with: node-version: 18 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - run: deno task build - working-directory: ./web - name: Install NPM deps run: npm install - name: Build legacy validator website run: npm run web-export - - name: Move legacy validator build into deno website - run: mv bids-validator-web/out web/dist/legacy - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3 with: - path: web/dist + path: bids-validator-web/out deploy: + name: Deploy web validator needs: build + if: github.event_name == 'release' && github.event.action == 'published' permissions: contents: read pages: write id-token: write - # Deploy to the github-pages environment environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - # Specify runner + deployment step runs-on: ubuntu-latest steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action + uses: actions/deploy-pages@v4