Skip to content

Commit

Permalink
chore: update actions images
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed May 10, 2024
1 parent 9423019 commit b18bd27
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cypress-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
# cache cypress runner
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cypress-cache
with:
path: /home/runner/.cache/Cypress
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/lint/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: verify linting rules
runs:
using: "composite"
steps:
- uses: nrwl/nx-set-shas@v3
- uses: nrwl/nx-set-shas@v4
- uses: './.github/actions/node-cache'
- name: Install deps
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/node-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
# cache node modules for all jobs to use
- uses: actions/cache@v3
- uses: actions/cache@v4
id: node_modules-cache
with:
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ runs:
using: "composite"
steps:
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- uses: './.github/actions/node-cache'
- name: Install deps
shell: bash
Expand Down
8 changes: 7 additions & 1 deletion .github/actions/test-e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: verify e2e tests
runs:
using: "composite"
steps:
- uses: nrwl/nx-set-shas@v3
- uses: nrwl/nx-set-shas@v4
- uses: './.github/actions/node-cache'
- uses: './.github/actions/cypress-cache'
- uses: './.github/actions/webpack-cache'
Expand All @@ -13,4 +13,10 @@ runs:
- name: Run e2e tests
shell: bash
run: npm run test:e2e
- name: Upload test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results
path: dist/cypress/examples/test-app-e2e/screenshots/

2 changes: 1 addition & 1 deletion .github/actions/test-unit/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: verify unit tests
runs:
using: "composite"
steps:
- uses: nrwl/nx-set-shas@v3
- uses: nrwl/nx-set-shas@v4
- uses: './.github/actions/node-cache'
- name: Install deps
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/webpack-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
# cache node modules for all jobs to use
- uses: actions/cache@v3
- uses: actions/cache@v4
id: webpack-cache
with:
path: |
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- uses: nrwl/nx-set-shas@v4
# cache node modules for all jobs to use
- uses: './.github/actions/node-cache'
# cache cypress runner
Expand All @@ -24,26 +24,26 @@ jobs:
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/lint'
test:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/test-unit'
build:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- uses: nrwl/nx-set-shas@v4
- uses: './.github/actions/node-cache'
- name: Install deps
run: npm i
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
needs: [install, build]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/test-e2e'
Expand All @@ -62,7 +62,7 @@ jobs:
needs: [install, lint, test, build, test-e2e]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.BOTH_AUTH_KEY }}
Expand Down
13 changes: 11 additions & 2 deletions e2e-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ try {
}

// ensure the deps exist before we start the servers
execSync('npm run build', { cwd: cdnPath, stdio: 'inherit'})
execSync('npm run build -c webpack.config.js', { cwd: cdnPath, stdio: 'inherit'})

console.log('Dist dir of assets:')
execSync('ls -la dist', { cwd: cdnPath, stdio: 'inherit'})
console.log('Root dir of assets:')
execSync('ls -la .', { cwd: cdnPath, stdio: 'inherit'})
console.log('Root dir:')
execSync('ls -la', { cwd: __dirname, stdio: 'inherit'})
console.log('Packages dist dir:')
execSync('ls -la dist/packages', { cwd: __dirname, stdio: 'inherit'})

const {result, commands} = concurrently(
[{
Expand All @@ -29,7 +38,7 @@ const {result, commands} = concurrently(
}, {
cwd: __dirname,
name: 'e2e',
command: 'npx wait-on federation-cdn-mock/dist http://localhost:4200 http://localhost:8001 -i 2000 && npx nx run test-app-e2e:e2e --skipNxCache',
command: 'npx wait-on http://localhost:4200 http://127.0.0.1:8001 && npx nx run test-app-e2e:e2e --skipNxCache',
}],
{
successCondition: 'e2e',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('Module error loading handling', () => {
cy.visit('http://localhost:4200/legacy');

// intercept webpack chunk and return 500 response
cy.intercept('GET', 'http://localhost:8001/exposed-./PreLoadedModule.js', {
cy.intercept('GET', 'http://127.0.0.1:8001/exposed-./PreLoadedModule.js', {
statusCode: 500,
});

Expand Down
6 changes: 3 additions & 3 deletions examples/test-app/src/entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const config: AppsConfig<{ assetsHost?: string }> = {
notFound: {
name: 'notFound',
manifestLocation: '/assets/testPath/foo/bar/nonsense.json',
assetsHost: 'http://localhost:8888',
assetsHost: 'http://127.0.0.1:8001',
},
'sdk-plugin': {
name: 'sdk-plugin',
assetsHost: 'http://localhost:8001',
manifestLocation: 'http://localhost:8001/plugin-manifest.json',
assetsHost: 'http://127.0.0.1:8001',
manifestLocation: 'http://127.0.0.1:8001/plugin-manifest.json',
},
};

Expand Down
2 changes: 2 additions & 0 deletions federation-cdn-mock/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// just a mock for webpack
// it tends to generate empty assets on CI without explicit entry
6 changes: 5 additions & 1 deletion federation-cdn-mock/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const { resolve } = require('path');
const { ModuleFederationPlugin, ContainerPlugin } = require('@module-federation/enhanced');
const { DynamicRemotePlugin } = require('@openshift/dynamic-plugin-sdk-webpack');

console.log("Entry tests:", resolve(__dirname, './src/modules/moduleOne.tsx'))

const sharedModules = {
react: {
singleton: true,
Expand Down Expand Up @@ -54,7 +56,9 @@ const TestSDKPLugin = new DynamicRemotePlugin({
function init() {
/** @type { import("webpack").Configuration } */
const config = {
entry: {},
entry: {
mock: resolve(__dirname, './src/index.tsx'),
},
cache: { type: 'filesystem', cacheDirectory: resolve(__dirname, '.cdn-cache')},
output: {
publicPath: 'auto',
Expand Down

0 comments on commit b18bd27

Please sign in to comment.