Skip to content

Commit 1ca86a3

Browse files
committed
feat: added setting up swift environment
- support macOS, linux completely - added limited support of Windows - added swift development versions support - added unit, integration and feature tests - added toolchain snapshot metadata auto-sync with swift.org
1 parent fde394e commit 1ca86a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+199104
-3
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
lib/
3+
node_modules/
4+
swiftorg/

.eslintrc.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"plugins": ["jest", "@typescript-eslint"],
3+
"extends": ["plugin:github/recommended"],
4+
"parser": "@typescript-eslint/parser",
5+
"parserOptions": {
6+
"ecmaVersion": 9,
7+
"sourceType": "module",
8+
"project": "./tsconfig.json"
9+
},
10+
"rules": {
11+
"i18n-text/no-en": "off",
12+
"eslint-comments/no-use": "off",
13+
"import/no-namespace": "off",
14+
"no-unused-vars": "off",
15+
"@typescript-eslint/no-unused-vars": "error",
16+
"@typescript-eslint/explicit-member-accessibility": [
17+
"error",
18+
{"accessibility": "no-public"}
19+
],
20+
"@typescript-eslint/no-require-imports": "error",
21+
"@typescript-eslint/array-type": "error",
22+
"@typescript-eslint/await-thenable": "error",
23+
"@typescript-eslint/ban-ts-comment": "error",
24+
"camelcase": "off",
25+
"@typescript-eslint/consistent-type-assertions": "error",
26+
"@typescript-eslint/func-call-spacing": ["error", "never"],
27+
"@typescript-eslint/no-array-constructor": "error",
28+
"@typescript-eslint/no-empty-interface": "error",
29+
"@typescript-eslint/no-explicit-any": "error",
30+
"@typescript-eslint/no-extraneous-class": "error",
31+
"@typescript-eslint/no-for-in-array": "error",
32+
"@typescript-eslint/no-inferrable-types": "error",
33+
"@typescript-eslint/no-misused-new": "error",
34+
"@typescript-eslint/no-non-null-assertion": "warn",
35+
"@typescript-eslint/no-unnecessary-qualifier": "error",
36+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
37+
"@typescript-eslint/no-useless-constructor": "error",
38+
"@typescript-eslint/no-var-requires": "error",
39+
"@typescript-eslint/prefer-for-of": "warn",
40+
"@typescript-eslint/prefer-function-type": "warn",
41+
"@typescript-eslint/prefer-includes": "error",
42+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
43+
"@typescript-eslint/promise-function-async": "error",
44+
"@typescript-eslint/require-array-sort-compare": "error",
45+
"@typescript-eslint/restrict-plus-operands": "error",
46+
"semi": "off",
47+
"@typescript-eslint/semi": ["error", "never"],
48+
"@typescript-eslint/type-annotation-spacing": "error",
49+
"@typescript-eslint/unbound-method": "error"
50+
},
51+
"env": {
52+
"node": true,
53+
"es6": true,
54+
"jest/globals": true
55+
}
56+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/** -diff linguist-generated=true

.github/changelog/config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict'
2+
const config = require('conventional-changelog-conventionalcommits');
3+
4+
module.exports = config({
5+
types: [
6+
{type: 'feat', section: '🚀 Features'},
7+
{type: 'fix', section: '🐛 Fixes'},
8+
{type: 'perf', section: '🐎 Performance Improvements'},
9+
{type: 'revert', section: '⏪ Reverts'},
10+
{type: 'build', section: '🛠 Build System'},
11+
{type: 'deps', section: '🛠 Dependency'},
12+
{type: 'refactor', section: '🔥 Refactorings'},
13+
{type: 'doc', section: '📚 Documentation'},
14+
{type: 'docs', section: '📚 Documentation'},
15+
{type: 'style', section: '💄 Styles'},
16+
{type: 'test', section: '✅ Tests'},
17+
{type: 'ci', hidden: true},
18+
{type: 'wip', hidden: true},
19+
{type: 'chore', hidden: true}
20+
]
21+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict'
2+
const semver = require('semver');
3+
const core = require('@actions/core');
4+
5+
exports.preVersionGeneration = (version) => {
6+
const {VERSION} = process.env;
7+
core.info(`Computed version bump: ${version}`);
8+
9+
const newVersion = semver.valid(VERSION);
10+
if (newVersion) {
11+
version = newVersion;
12+
core.info(`Using provided version: ${version}`);
13+
}
14+
return version;
15+
};
16+
17+
exports.preTagGeneration = (tag) => {};

.github/changelog/pre_commit_hook.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict'
2+
const core = require('@actions/core');
3+
const {exec, getExecOutput} = require('@actions/exec');
4+
5+
exports.preCommit = async (props) => {
6+
const gitOptions = {cwd: 'swiftorg'};
7+
const {stdout} = await getExecOutput('git', ['rev-parse', '--verify', 'HEAD'], gitOptions);
8+
const swiftorg = stdout.trim();
9+
core.info(`Updating swiftorg to "${swiftorg}"`);
10+
await exec('npm', ['pkg', 'set', `swiftorg=${swiftorg}`]);
11+
12+
core.startGroup(`Bundling`);
13+
await exec('npm install');
14+
await exec('npm run package');
15+
core.endGroup();
16+
};

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
commit-message:
8+
prefix: 'ci(Deps): '
9+
10+
- package-ecosystem: gitsubmodule
11+
directory: /
12+
schedule:
13+
interval: daily
14+
commit-message:
15+
prefix: 'build: '
16+
17+
- package-ecosystem: npm
18+
directory: /
19+
schedule:
20+
interval: monthly
21+
commit-message:
22+
prefix: 'deps: '
23+
prefix-development: 'chore: '

0 commit comments

Comments
 (0)