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

chore: make build workflow work on GitHub Actions #16

Merged
merged 5 commits into from
Nov 8, 2024
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
24 changes: 15 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build
name: Build Screenly Chrome Extension

on:
pull_request:
Expand All @@ -14,30 +14,36 @@ jobs:
deploy:
runs-on: ubuntu-latest

name: Build and generate Artifact
name: Build and Generate Artifact
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
- name: Build Docker images
run: |
docker compose build

# This step should probably be rewritten
- name: Generate
- name: Run Unit Tests
run: |
docker run \
--rm \
-v $(pwd):/app:delegated \
-v /app/node_modules \
sce_webpack:latest \
/bin/bash -c "npx webpack --config webpack.dev.js && npm run teamcity"
/bin/bash -c "npx webpack --config webpack.dev.js && npm run test"


- name: Generate
- name: Build and Package the Extension
run: |
mkdir artifacts

docker run \
--rm \
-v $(pwd)/artifacts:/app/artifacts:delegated \
-v /app/artifacts/node_modules \
sce_webpack:latest \
/bin/bash -c "npm run build && cd dist && zip -r ../artifacts/screenly-chrome-extension.zip *"

- name: Upload Archive as Artifact
uses: actions/upload-artifact@v4
with:
name: screenly-chrome-extension
path: artifacts/screenly-chrome-extension.zip
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"scripts": {
"test": "karma start --single-run --browsers ChromeHeadlessNoSandbox karma.conf.js",
"teamcity": "karma start --reporters teamcity --colors false --single-run --browsers ChromeHeadlessNoSandbox karma.conf.js",
"build": "webpack --config webpack.prod.js"
},
"author": "Screenly, Inc."
Expand Down
4 changes: 2 additions & 2 deletions src/test/spec/test-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import {
fetchToken,
State
} from "../../assets/js/main";
} from "../../assets/js/main.mjs";

function mockFetchResponse(status, statusText, body) {
return Promise.resolve({
Expand Down Expand Up @@ -247,4 +247,4 @@ describe("State", function() {
});
});

});
});