From b67bf53b01c93d4e3946e6b5677aa54ff62d4bc5 Mon Sep 17 00:00:00 2001 From: David Graham Date: Mon, 28 Aug 2023 12:28:36 -0400 Subject: [PATCH] clean up and use consistent style in github action workflows --- .github/workflows/build_image.yaml | 13 ++++---- .github/workflows/dependency_review.yaml | 1 + .github/workflows/docs.yaml | 10 ++++--- .github/workflows/release-drafter.yaml | 1 + .github/workflows/release.yaml | 4 +++ .github/workflows/test_client.yaml | 38 ++++++++++++++++++++---- .github/workflows/test_server.yaml | 8 +++-- client/package-lock.json | 4 +-- 8 files changed, 59 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_image.yaml b/.github/workflows/build_image.yaml index 6d54e9b87..eb346bcfd 100644 --- a/.github/workflows/build_image.yaml +++ b/.github/workflows/build_image.yaml @@ -15,34 +15,35 @@ on: jobs: build_image: + name: 'Build Docker Image' runs-on: ubuntu-latest defaults: run: working-directory: ${{ inputs.context }} steps: - - name: Checkout + - name: 'Checkout' uses: actions/checkout@v3 - - name: Docker meta + - name: 'Docker meta' id: meta uses: docker/metadata-action@v4 with: images: ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }} - - name: Set up QEMU + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx + - name: 'Set up Docker Buildx' uses: docker/setup-buildx-action@v2 - - name: Login to GitHub Image Registry + - name: 'Login to GitHub Image Registry' uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push + - name: 'Build and push' uses: docker/build-push-action@v3 with: context: ${{ inputs.context }} diff --git a/.github/workflows/dependency_review.yaml b/.github/workflows/dependency_review.yaml index 03961ae75..bb219f730 100644 --- a/.github/workflows/dependency_review.yaml +++ b/.github/workflows/dependency_review.yaml @@ -15,6 +15,7 @@ permissions: jobs: dependency-review: + name: 'Review Dependencies' runs-on: ubuntu-latest steps: - name: 'Checkout Repository' diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 2e4671e45..f705c64f1 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,28 +19,30 @@ concurrency: jobs: build: + name: 'Build Documentation' runs-on: ubuntu-latest defaults: run: working-directory: ./docs/haztrak_book steps: - - name: Checkout + - name: 'Checkout Repo' uses: actions/checkout@v2 - - name: Setup mdBook + - name: 'Setup mdBook' run: | mkdir bin curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.25/mdbook-v0.4.25-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin - - name: Build Documentation + - name: 'Build Documentation' run: bin/mdbook build - - name: upload Docs + - name: 'Upload Docs' uses: actions/upload-pages-artifact@v1 with: path: ./docs/haztrak_book/book deploy_pages: + name: 'Deploy Documentation' needs: build environment: name: github-pages diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml index a34972367..b950d411d 100644 --- a/.github/workflows/release-drafter.yaml +++ b/.github/workflows/release-drafter.yaml @@ -14,6 +14,7 @@ permissions: jobs: update_release_draft: + name: 'Update Release Draft' permissions: # write permission is required to update the release draft contents: write diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 073d41f9f..70a96bf73 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,12 +9,15 @@ on: jobs: test_server: + name: 'Run Server Tests' uses: ./.github/workflows/test_server.yaml test_client: + name: 'Run Client Tests' uses: ./.github/workflows/test_client.yaml build_server: + name: 'Build Server Image' needs: [test_server] uses: ./.github/workflows/build_image.yaml with: @@ -22,6 +25,7 @@ jobs: image_name: haztrak-server build_client: + name: 'Build Client Image' needs: [test_client] uses: ./.github/workflows/build_image.yaml with: diff --git a/.github/workflows/test_client.yaml b/.github/workflows/test_client.yaml index ac6a72c43..28c7f149f 100644 --- a/.github/workflows/test_client.yaml +++ b/.github/workflows/test_client.yaml @@ -12,27 +12,29 @@ on: jobs: run_client_tests: + name: 'Run Client Tests' runs-on: ubuntu-latest defaults: run: working-directory: ./client strategy: matrix: - node-version: [16, 18] + node-version: [18, 20] steps: - - uses: actions/checkout@v3 + - name: 'Checkout' + uses: actions/checkout@v3 - - name: Setup Node + - name: 'Setup Node' uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: '**/package-lock.json' - - name: Install Dependencies + - name: 'Install Dependencies' run: npm ci - - name: configure env + - name: 'Configure env' run: | mv ../configs/.env.test .env echo "VITE_HT_ENV=TEST" >> .env @@ -41,3 +43,29 @@ jobs: run: npm test env: VITE_HT_ENV: 'TEST' + + test_client_build: + name: 'Test Build Client' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./client + strategy: + matrix: + node-version: [18, 20] + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + + - name: 'Setup Node' + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + + - name: 'Install Dependencies' + run: npm ci + + - name: 'Build Client' + run: npm run build diff --git a/.github/workflows/test_server.yaml b/.github/workflows/test_server.yaml index fdfe278a6..aa6140286 100644 --- a/.github/workflows/test_server.yaml +++ b/.github/workflows/test_server.yaml @@ -22,6 +22,7 @@ defaults: jobs: run_server_tests: + name: 'Run Server Tests' runs-on: ubuntu-latest strategy: @@ -44,7 +45,8 @@ jobs: --health-retries 5 steps: - - uses: actions/checkout@v3 + - name: 'Checkout' + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 @@ -52,12 +54,12 @@ jobs: cache: 'pip' python-version: ${{ matrix.python-version }} - - name: Install Dependencies + - name: 'Install Dependencies' run: | python -m pip install --upgrade pip pip install -r requirements_dev.txt - - name: Run Tests + - name: 'Run Tests' env: HT_SECRET_KEY: 'django-insecure-%btjqoun@6ps$e@8bw$48s+!x1e4aiz&5p2nrf6cmiw4)jsx5d' HT_CORS_DOMAIN: http://localhost:3000 diff --git a/client/package-lock.json b/client/package-lock.json index 01d906acd..55e3e0c10 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,12 +1,12 @@ { "name": "haztrak", - "version": "0.5.2", + "version": "0.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "haztrak", - "version": "0.5.2", + "version": "0.6.0", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.4.2", "@fortawesome/free-brands-svg-icons": "^6.4.2",