Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Simplify workflows #2391

Draft
wants to merge 3 commits into
base: alpha
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 23 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: ci
on:
push:
branches: [ release, alpha, beta, next-major ]
branches: [release, alpha, beta, next-major]
pull_request:
branches:
- '**'
- "**"
env:
NODE_VERSION: 18.9.0
jobs:
Expand All @@ -13,18 +13,12 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
cache: "npm"
- name: Install dependencies
run: npm ci --ignore-scripts
- name: CI Node Engine Check
Expand All @@ -34,38 +28,26 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
cache: "npm"
- name: Install dependencies
run: npm ci --ignore-scripts
- run: npm run lint
check-circular:
name: Circular Dependencies
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Circular Dependencies
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
cache: "npm"
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Scan for circular dependencies
Expand All @@ -88,21 +70,21 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Build docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
platforms: ${{ matrix.DOCKER_PLATFORM }}
check-lock-file-version:
name: NPM Lock File Version
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check NPM lock file version
uses: mansona/npm-lockfile-version@v1
with:
Expand All @@ -124,16 +106,9 @@ jobs:
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Determine major node version
id: node
run: |
node_major=$(echo "${{ matrix.NODE_VERSION }}" | cut -d'.' -f1)
echo "::set-output name=node_major::$(echo $node_major)"
- name: Fix usage of insecure GitHub protocol
run: sudo git config --system url."https://github".insteadOf "git://github"
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.NODE_VERSION }}
- name: Cache Node.js modules
Expand All @@ -142,7 +117,7 @@ jobs:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
- name: Install dependencies
run: npm ci
- name: Tests
Expand Down
105 changes: 29 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@babel/runtime": "7.20.13",
"@babel/runtime-corejs3": "7.20.13",
"bcryptjs": "2.3.0",
"body-parser": "1.20.0",
"body-parser": "1.20.1",
"commander": "9.4.0",
"connect-flash": "0.1.1",
"cookie-session": "2.0.0",
Expand Down