Skip to content

Commit

Permalink
ci: switch to shared actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanosdev committed Dec 5, 2024
1 parent 3644d3f commit 8709015
Show file tree
Hide file tree
Showing 11 changed files with 464 additions and 588 deletions.
1 change: 0 additions & 1 deletion .cz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
commitizen:
name: cz_conventional_commits
tag_format: $version
update_changelog_on_bump: true
version: 2.6.0
version_files:
- Cargo.toml
Expand Down
13 changes: 0 additions & 13 deletions .github/actions/setup-dfx/action.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/actions/setup-pnpm/action.yml

This file was deleted.

16 changes: 9 additions & 7 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main

env:
SCCACHE_GHA_ENABLED: 'true'
Expand All @@ -18,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run sccache-cache
uses: mozilla-actions/[email protected]
Expand All @@ -43,11 +41,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: ./.github/actions/setup-pnpm
- name: Setup PNPM
uses: dfinity/ci-tools/actions/setup-pnpm@main

- uses: ./.github/actions/setup-dfx
- name: Setup DFX
uses: dfinity/setup-dfx@main
with:
dfx-version: 'auto'

- name: Run sccache-cache
uses: mozilla-actions/[email protected]
Expand All @@ -57,7 +59,7 @@ jobs:
- name: Cargo metadata
run: cargo metadata --format-version 1

- name: Install wasm-pack
- name: Setup wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Generate canister declarations
Expand Down
24 changes: 3 additions & 21 deletions .github/workflows/check-commit-messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,10 @@ name: Check commit messages

on:
pull_request:
branches:
- main

jobs:
check_commit_messages:
name: Check Commit Messages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Commitzen
run: |
python -m pip install --upgrade pip
pip install -U Commitizen
- name: Check Commit Messages
run: cz check --rev-range ac8f90b7c45e13e240d6c01a43d191b99f1aec4a..HEAD
uses: dfinity/ci-tools/.github/workflows/check-commit-messages.yaml@nathan/main
with:
starting_commit: 'ac8f90b7c45e13e240d6c01a43d191b99f1aec4a'
8 changes: 8 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Check pr title

on:
pull_request:

jobs:
check_pr_title:
uses: dfinity/ci-tools/.github/workflows/check-pr-title.yaml@nathan/main
10 changes: 6 additions & 4 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/setup-pnpm
- name: Setup PNPM
uses: dfinity/ci-tools/actions/setup-pnpm@main

- uses: ./.github/actions/setup-dfx
- name: Setup DFX
uses: dfinity/setup-dfx@main

- name: Install wasm-pack
- name: Setup wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Run sccache-cache
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main

env:
SCCACHE_GHA_ENABLED: 'true'
Expand All @@ -18,9 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: ./.github/actions/setup-pnpm
- name: Setup PNPM
uses: dfinity/ci-tools/actions/setup-pnpm@main

- name: Run sccache-cache
uses: mozilla-actions/[email protected]
Expand All @@ -31,7 +30,7 @@ jobs:
path: tmp/
key: ${{ runner.os }}-tmp

- name: Install wasm-pack
- name: Setup wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: e2e tests
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/setup-pnpm
- name: Setup PNPM
uses: dfinity/ci-tools/actions/setup-pnpm@main

- uses: ./.github/actions/setup-dfx
- name: Setup DFX
uses: dfinity/setup-dfx@main

- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Setup Python
uses: dfinity/ci-tools/actions/setup-python@main

- name: Setup Commitizen
run: pip install commitizen==2.42.1
uses: dfinity/ci-tools/actions/setup-commitizen@main

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Expand Down
38 changes: 5 additions & 33 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,8 @@ on:

jobs:
update_changelog:
name: Update Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Commitzen
run: |
python -m pip install --upgrade pip
pip install -U Commitizen
- name: Check Commit Messages
run: cz check --rev-range c8ecbc19b8c4a482e55907d37554d66f2f2f9a8f..HEAD

- name: Update Changelog
run: cz changelog

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
title: 'Update changelog'
commit-message: 'chore: update changelog'
branch: 'chore/update-changelog'
branch-suffix: 'short-commit-hash'
add-paths: |
CHANGELOG.md
uses: dfinity/ci-tools/.github/workflows/generate-changelog.yaml@nathan/main
with:
auto_merge: true
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 8709015

Please sign in to comment.