Commit a8c5987
authored
Generate Artifacts Outside the Tags Context (#15)
This pull request introduces changes to improve the handling of GitHub
Actions workflows by adding support for tag-based operations and
refactoring the configuration setup. Additionally, it includes updates
to testing configurations and test cases to align with these changes.
### GitHub Actions Workflow Enhancements:
*
[`src/configuration.ts`](diffhunk://#diff-0931cf958317ce57b36bdf11695eaa9ce4ebeec0f9ae067343159a85d75732dfL7-R10):
Added a new `env` parameter to the `Configuration` class and a method
`isTag` to determine if the workflow is triggered by a tag reference.
[[1]](diffhunk://#diff-0931cf958317ce57b36bdf11695eaa9ce4ebeec0f9ae067343159a85d75732dfL7-R10)
[[2]](diffhunk://#diff-0931cf958317ce57b36bdf11695eaa9ce4ebeec0f9ae067343159a85d75732dfR19-R22)
*
[`src/main.ts`](diffhunk://#diff-4fab5baaca5c14d2de62d8d2fceef376ddddcc8e9509d86cfa5643f51b89ce3dL9-R20):
Updated the `main` function to conditionally execute temporary branch
creation and deletion based on the `isTag` property.
*
[`src/model/artifacts.ts`](diffhunk://#diff-5595f77bb2b2f49522043f8dcd486390018618b047f219418459269c756ecc03L19-R21):
Modified the `Artifacts` class to conditionally execute tag-related
tasks (`collect` and `move`) based on the `isTag` property.
### Testing Updates:
*
[`tests/unit/model/artifacts.test.ts`](diffhunk://#diff-7038a68cfc252210ef35773ee922184899920f50ea4663f60096442511db507eR138-R180):
Added a new test case to verify that tag-related tasks are skipped when
the action is not triggered by a tag. Updated the `configuration`
function to accept an optional `env` parameter for testing purposes.
### Configuration and File Structure Adjustments:
*
[`jest.config.ts`](diffhunk://#diff-860bd1f15d1e0bafcfc6f62560524f588e6d6bf56d4ab1b0f6f8146461558730L7-R10):
Updated paths in `moduleNameMapper` and `setupFilesAfterEnv` to reflect
the new file structure after renaming `tests/jest.config.ts` to
`jest.config.ts`.
*
[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L33-R33):
Simplified the Jest configuration in the `test` script to use the
default `jest.config.ts`.
*
[`tests/tsconfig.json`](diffhunk://#diff-9ef891bf14629264f353ee51ca7dad4267563a5d90ad7e3c62030eba140bf5c9L12-R12):
Adjusted the `include` paths to match the updated file structure.1 parent 9024e90 commit a8c5987
File tree
8 files changed
+61
-14
lines changed- dist
- src
- model
- tests
- unit/model
8 files changed
+61
-14
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
138 | 169 | | |
139 | 170 | | |
140 | | - | |
141 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
142 | 181 | | |
143 | 182 | | |
144 | 183 | | |
| |||
0 commit comments