|
23 | 23 | NPM_CONFIG_UNSAFE_PERM: true |
24 | 24 |
|
25 | 25 | jobs: |
26 | | - compliance: |
27 | | - runs-on: ubuntu-latest |
28 | | - steps: |
29 | | - - name: Checkout code |
30 | | - uses: actions/checkout@v4 |
31 | | - with: |
32 | | - fetch-depth: 0 |
33 | | - submodules: true |
34 | | - |
35 | | - - name: Setup Node.js 18 |
36 | | - uses: actions/setup-node@v4 |
37 | | - with: |
38 | | - node-version: '18' |
39 | | - cache: 'npm' |
40 | | - |
41 | | - - name: Install dependencies |
42 | | - run: npm ci --unsafe-perm |
43 | | - |
44 | | - - name: Run compliance checks |
45 | | - run: | |
46 | | - npm run lint |
47 | | - npm run test_conditions |
48 | | -
|
49 | | - test: |
50 | | - runs-on: ubuntu-latest |
51 | | - permissions: |
52 | | - id-token: write |
53 | | - contents: read |
54 | | - strategy: |
55 | | - fail-fast: false |
56 | | - matrix: |
57 | | - node-version: ['18', '20', '22'] |
58 | | - test-type: ['node', 'browser'] |
59 | | - test-category: ['coverage', 'vectors'] |
60 | | - name: test-${{ matrix.test-category }}-${{ matrix.test-type }}${{ matrix.node-version }} |
61 | | - steps: |
62 | | - - name: Checkout code |
63 | | - uses: actions/checkout@v4 |
64 | | - with: |
65 | | - fetch-depth: 0 |
66 | | - submodules: true |
67 | | - |
68 | | - - name: Setup Node.js ${{ matrix.node-version }} |
69 | | - uses: actions/setup-node@v4 |
70 | | - with: |
71 | | - node-version: ${{ matrix.node-version }} |
72 | | - cache: 'npm' |
73 | | - |
74 | | - - name: Configure AWS Credentials for Tests |
75 | | - uses: aws-actions/configure-aws-credentials@v4 |
76 | | - with: |
77 | | - aws-region: us-west-2 |
78 | | - role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2 |
79 | | - role-session-name: JavaScriptTests |
80 | | - |
81 | | - - name: Install dependencies and build |
82 | | - run: | |
83 | | - npm ci --unsafe-perm |
84 | | - npm run build |
85 | | -
|
86 | | - - name: Run ${{ matrix.test-category }} tests (${{ matrix.test-type }}) |
87 | | - run: | |
88 | | - if [ "${{ matrix.test-category }}" = "coverage" ]; then |
89 | | - npm run coverage-${{ matrix.test-type }} |
90 | | - elif [ "${{ matrix.test-category }}" = "vectors" ]; then |
91 | | - npm run verdaccio-publish |
92 | | - npm run verdaccio-${{ matrix.test-type }}-decrypt |
93 | | - npm run verdaccio-${{ matrix.test-type }}-encrypt |
94 | | - else |
95 | | - echo "Error: Unrecognized test category '${{ matrix.test-category }}'" |
96 | | - exit 1 |
97 | | - fi |
| 26 | + pre-release-ci: |
| 27 | + uses: ./.github/workflows/shared-ci.yml |
98 | 28 |
|
99 | 29 | # Once all tests have passed, run semantic versioning |
100 | 30 | version: |
101 | 31 | runs-on: ubuntu-latest |
102 | | - needs: [compliance, test] |
| 32 | + needs: [pre-release-ci] |
103 | 33 | steps: |
104 | 34 | - name: Checkout code |
105 | 35 | uses: actions/checkout@v4 |
@@ -138,47 +68,8 @@ jobs: |
138 | 68 |
|
139 | 69 | # Once publishing is complete, validate that the published packages are useable |
140 | 70 | validate: |
141 | | - runs-on: ubuntu-latest |
| 71 | + uses: ./.github/workflows/shared-ci.yml |
142 | 72 | # TODO: Uncomment when adding publish step |
143 | 73 | # needs: [publish] |
144 | | - permissions: |
145 | | - id-token: write |
146 | | - contents: read |
147 | | - strategy: |
148 | | - fail-fast: false |
149 | | - matrix: |
150 | | - node-version: ['18', '20', '22'] |
151 | | - test-type: ['node', 'browser'] |
152 | | - name: validate-${{ matrix.test-type }}${{ matrix.node-version }} |
153 | | - steps: |
154 | | - - name: Checkout code |
155 | | - uses: actions/checkout@v4 |
156 | | - with: |
157 | | - fetch-depth: 0 |
158 | | - submodules: true |
159 | | - |
160 | | - - name: Setup Node.js ${{ matrix.node-version }} |
161 | | - uses: actions/setup-node@v4 |
162 | | - with: |
163 | | - node-version: ${{ matrix.node-version }} |
164 | | - cache: 'npm' |
165 | | - |
166 | | - - name: Configure AWS Credentials for Tests |
167 | | - uses: aws-actions/configure-aws-credentials@v4 |
168 | | - with: |
169 | | - aws-region: us-west-2 |
170 | | - role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2 |
171 | | - role-session-name: JavaScriptTests |
172 | | - |
173 | | - - name: Install dependencies |
174 | | - run: npm ci --unsafe-perm |
175 | | - |
176 | | - - name: Validate published packages - ${{ matrix.test-type }} |
177 | | - # This will fail until the publish step is run for the first time. |
178 | | - # A dependency change broke the browser tests. |
179 | | - # Commit fb10180dfb451ff5359ebc703c58eaf5393971ac fixes this. |
180 | | - # The first publish step for v4.2.2+ should make this pass. |
181 | | - # TODO: Remove this comment block after first successful publish of v4.2.2+. |
182 | | - run: | |
183 | | - npm run verdaccio-${{ matrix.test-type }}-decrypt |
184 | | - npm run verdaccio-${{ matrix.test-type }}-encrypt |
| 74 | + with: |
| 75 | + test-published-packages: true |
0 commit comments