From 869eae1a0e92cba9963ae872d364dab0c1f61a97 Mon Sep 17 00:00:00 2001 From: Joel Arvidsson Date: Thu, 26 Dec 2024 23:30:50 +0100 Subject: [PATCH] Run static analysis in CI --- .github/workflows/ci.yml | 38 ++++++++++++++++++ .node-version | 1 + package-lock.json | 83 ++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 4 files changed, 123 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .node-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..32231b8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +# +name: CI + +on: + workflow_dispatch: + pull_request: + types: [opened, synchronize] + paths-ignore: + - '**/*.md' + - '**/*.yml' + - '!.github/workflows/ci.yml' + push: + branches: + - master + paths-ignore: + - '**/*.md' + - '**/*.yml' + - '!.github/workflows/ci.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: ${{ github.ref_name != 'master' }} + +jobs: + static-analysis: + name: Static Analysis + strategy: + fail-fast: false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + - run: npm ci + - run: npm run typecheck + - run: npm run lint-ci diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..2a393af --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +20.18.0 diff --git a/package-lock.json b/package-lock.json index 39f311b..10fa40a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "example" ], "devDependencies": { + "@jamesacarr/eslint-formatter-github-actions": "^0.2.0", "@react-native/eslint-config": "0.76.5", "@types/jest": "^29.5.12", "@types/react": "^18.3.4", @@ -60,6 +61,45 @@ "node": ">=18" } }, + "node_modules/@actions/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", + "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" + } + }, + "node_modules/@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/io": "^1.0.1" + } + }, + "node_modules/@actions/http-client": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", + "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "node_modules/@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -2172,6 +2212,16 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -2368,6 +2418,16 @@ "node": ">=8" } }, + "node_modules/@jamesacarr/eslint-formatter-github-actions": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@jamesacarr/eslint-formatter-github-actions/-/eslint-formatter-github-actions-0.2.0.tgz", + "integrity": "sha512-/BMX+d6Pg36aHi7FmRsyCXUXCFQOVnJap1xl97kgglNE++d2HtqR6eHVxL56wXnXqC5wyI4T9Y3e2RccyubqQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/core": "^1.10.0" + } + }, "node_modules/@jest/console": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", @@ -12016,6 +12076,16 @@ "dev": true, "license": "0BSD" }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -12158,6 +12228,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/undici-types": { "version": "6.20.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", diff --git a/package.json b/package.json index edf62b6..292a905 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "registry": "https://registry.npmjs.org/" }, "devDependencies": { + "@jamesacarr/eslint-formatter-github-actions": "^0.2.0", "@react-native/eslint-config": "0.76.5", "@types/jest": "^29.5.12", "@types/react": "^18.3.4",