Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dedicated test workflow #32

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add dedicated test workflow
  • Loading branch information
MattIPv4 committed Nov 28, 2022
commit 0be40e2392cdf6db35d8840ad2fdbd63a6611102
4 changes: 2 additions & 2 deletions .github/workflows/do-spaces-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Test and Deploy to DigitalOcean Spaces
name: Deploy to DigitalOcean Spaces

on: push

permissions:
contents: write

jobs:
build:
deploy-spaces:
runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test and Deploy to GitHub Pages
name: Deploy to GitHub Pages

on:
push:
Expand All @@ -16,7 +16,7 @@ concurrency:
cancel-in-progress: true

jobs:
build:
deploy-pages:
runs-on: ubuntu-latest

steps:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test and Build

on: pull_request

permissions:
contents: read

jobs:
test-build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Build tool
run: npm run build
env:
STUB_IMAGE_DATA: true
5 changes: 5 additions & 0 deletions src/build/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ const save = async data => {
};

const main = async () => {
if (process.env.STUB_IMAGE_DATA === 'true') {
await save([]);
return;
}

const results = [];
let nextPage = `https://api.digitalocean.com/v2/images?page=1&type=${process.env.IMAGE_TYPE}`;
while (nextPage) {
Expand Down