Skip to content

Commit

Permalink
ci: fix ci dependency check and versions
Browse files Browse the repository at this point in the history
  • Loading branch information
chmanie committed Oct 30, 2024
1 parent 2906d9f commit 113ee8a
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8.14.1
version: 8.15.9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8.14.1
- name: Use Node.js 20.x
uses: actions/setup-node@v4
version: 8.15.9
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20.x'
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Cache NPM dependencies
uses: actions/cache@v4
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm run bootstrap
# Exclude the build of sdk and colony-js as it's not necessary for the docs to build
- run: pnpm --filter '!sdk' --filter '!colony-js' run build
Expand Down
31 changes: 11 additions & 20 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,49 @@ on:
default: 'true'
type: boolean

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release-snapshot:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.11.0]
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 8.15.5

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
version: 8.15.9
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Cache NPM dependencies
uses: actions/cache@v4
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
- name: Set relevant environment variables
run: |
if [[ ${{ github.event.inputs.includeNext }} == 'true' ]]; then
echo "COLONY_CONTRACTOR_INCLUDE_NEXT=true" >> $GITHUB_ENV
fi
- name: Create .npmrc (to be logged in for publishing)
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: pnpm run bootstrap

- run: pnpm run lint

- run: pnpm run build
env:
NODE_OPTIONS: --max-old-space-size=4096

- run: pnpm run test
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096

- name: Generate git hash of current HEAD
run: echo "VERSION_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Version snapshot
run: npx changeset version --snapshot snapshot-${{ env.VERSION_HASH }} && pnpm install --lockfile-only

- name: Publish snapshot to npm
run: npx changeset publish --snapshot --tag snapshot --no-git-tag
20 changes: 11 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ on:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.10.0]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8.14.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
version: 8.15.9
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Cache NPM dependencies
uses: actions/cache@v4
id: cache
with:
node-version: ${{ matrix.node-version }}
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm run bootstrap
- name: Create Release Pull Request or Publish to npm
id: changesets
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/sdk-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.10.0]
node-version: [20.15.1]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8.14.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
version: 8.15.9
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Cache NPM dependencies
uses: actions/cache@v4
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm run bootstrap
- run: pnpm --filter "!colony-js" run build
- run: pnpm --filter "sdk" run build-examples
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12.2
20.15.1
12 changes: 6 additions & 6 deletions flake.lock

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

6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
description = "Flake to develop the colonyJS using nix(OS)";

inputs = {
nixpkgs_node.url = "github:NixOS/nixpkgs/24.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
};

outputs = {
self,
nixpkgs_node
nixpkgs
}: {
devShell.x86_64-linux = with nixpkgs_node.legacyPackages.x86_64-linux;
devShell.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux;
mkShell {
buildInputs = [nodejs_20 pnpm_8 zsh];
shellHook = "exec zsh";
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit 113ee8a

Please sign in to comment.