diff --git a/.github/workflows/check-types.yml b/.github/workflows/check-types.yml deleted file mode 100644 index 93295df..0000000 --- a/.github/workflows/check-types.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Check Types -on: - pull_request: - push: -jobs: - check_types: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version-file: ".node-version" - - name: Install dependencies - run: npm ci - - name: Check types - run: tsc -p tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b80ddec --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Lint GitHub Action workflows + uses: raven-actions/actionlint@v2 + + npm-install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm install --package-lock-only --ignore-scripts --no-audit --no-fund + - run: git diff --exit-code -- package-lock.json + + eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm run lint:eslint + + prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm run lint:prettier + + tsc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm run lint:tsc + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm run build + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 4961e27..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Lint -on: - pull_request: - push: -jobs: - run_lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version-file: ".node-version" - - name: Install dependencies - run: npm ci - - name: Run ESLint - run: npm run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 2dee730..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Test -on: - pull_request: - push: -jobs: - run_tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version-file: ".node-version" - - name: Install dependencies - run: npm ci - - name: Run tests - run: npm test