diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f54a6d3..23340c1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,5 +1,5 @@ --- -name: Build +name: Build Screenly Chrome Extension on: pull_request: @@ -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 diff --git a/package.json b/package.json index 5d8adfe..3661b86 100644 --- a/package.json +++ b/package.json @@ -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." diff --git a/src/test/spec/test-main.js b/src/test/spec/test-main.js index ccc61b9..649d9cd 100644 --- a/src/test/spec/test-main.js +++ b/src/test/spec/test-main.js @@ -6,7 +6,7 @@ import { fetchToken, State -} from "../../assets/js/main"; +} from "../../assets/js/main.mjs"; function mockFetchResponse(status, statusText, body) { return Promise.resolve({ @@ -247,4 +247,4 @@ describe("State", function() { }); }); -}); \ No newline at end of file +});