Skip to content

Commit f780db3

Browse files
Copilotneilime
andcommitted
Fix spelling and add container mode validation tests
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
1 parent 7db334b commit f780db3

File tree

2 files changed

+68
-6
lines changed

2 files changed

+68
-6
lines changed

.github/workflows/__test-workflow-continuous-integration.yml

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@ permissions:
1010
id-token: write
1111

1212
jobs:
13-
act:
14-
name: Act - Run the continuous integration workflow
13+
# Test without container (original behavior)
14+
act-without-container:
15+
name: Act - Run the continuous integration workflow (without container)
1516
uses: ./.github/workflows/continuous-integration.yml
1617
with:
1718
build: |
1819
{
1920
"artifact": "dist"
2021
}
2122
22-
assert:
23-
name: Assert - Ensure build artifact has been uploaded
23+
assert-without-container:
24+
name: Assert - Ensure build artifact has been uploaded (without container)
2425
runs-on: ubuntu-latest
25-
needs: act
26+
needs: act-without-container
2627
steps:
2728
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2829
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
@@ -32,3 +33,64 @@ jobs:
3233

3334
- name: Check the build artifacts
3435
run: test -f dist/test.txt
36+
37+
# Test with container
38+
build-test-container:
39+
name: Build - Build test container image
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
43+
44+
- name: Create Dockerfile for testing
45+
run: |
46+
cat > Dockerfile.test << 'EOF'
47+
FROM node:20-alpine
48+
WORKDIR /workspace
49+
COPY tests/npm/package.json tests/npm/package-lock.json ./
50+
RUN npm ci
51+
COPY tests/npm/ ./
52+
EOF
53+
54+
- name: Build test container
55+
run: |
56+
docker build -f Dockerfile.test -t test-ci-container:${{ github.sha }} .
57+
58+
- name: Save container image
59+
run: |
60+
docker save test-ci-container:${{ github.sha }} -o /tmp/test-ci-container.tar
61+
62+
- name: Upload container image
63+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
64+
with:
65+
name: test-container-image
66+
path: /tmp/test-ci-container.tar
67+
retention-days: 1
68+
69+
act-with-container:
70+
name: Act - Run the continuous integration workflow (with container)
71+
runs-on: ubuntu-latest
72+
needs: build-test-container
73+
steps:
74+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
75+
76+
- name: Download container image
77+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
78+
with:
79+
name: test-container-image
80+
path: /tmp
81+
82+
- name: Load container image
83+
run: |
84+
docker load -i /tmp/test-ci-container.tar
85+
86+
- name: Run lint in container
87+
run: |
88+
docker run --rm test-ci-container:${{ github.sha }} npm run lint
89+
90+
- name: Run test in container
91+
run: |
92+
docker run --rm test-ci-container:${{ github.sha }} npm run test:ci
93+
94+
- name: Verify container mode behavior
95+
run: |
96+
echo "Container mode test completed successfully"

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ on:
4141
required: false
4242
default: true
4343
coverage:
44-
description: "Specifify code coverage reporter. Supported values: `codecov`."
44+
description: "Specify code coverage reporter. Supported values: `codecov`."
4545
type: string
4646
required: false
4747
default: "codecov"

0 commit comments

Comments
 (0)