Skip to content

Commit

Permalink
ci: switch to shared actions (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanosdev authored Jan 21, 2025
1 parent e5df912 commit d53a44e
Show file tree
Hide file tree
Showing 13 changed files with 579 additions and 578 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: 3.0.2
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.

22 changes: 12 additions & 10 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
name: Build and Test
name: build_and_test

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
SCCACHE_GHA_ENABLED: 'true'
RUSTC_WRAPPER: 'sccache'

jobs:
build_and_test_rust:
name: Build and Test Rust
name: build_and_test_rust:required
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
Expand All @@ -39,15 +37,19 @@ jobs:
run: cargo fmt --all -- --check

build_and_test_js:
name: Build and Test JavaScript
name: build_and_test_js:required
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/sccache-action@v0.0.3
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
29 changes: 0 additions & 29 deletions .github/workflows/check-commit-messages.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/commitizen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: commitizen

on:
pull_request:

jobs:
check_commit_messages:
name: check_commit_messages:required
uses: dfinity/ci-tools/.github/workflows/check-commit-messages.yaml@main
with:
starting_commit: '4b3de72e9b2a1ea5b700851c25db6f42cb55e8fa'

check_pr_title:
name: check_pr_title:required
uses: dfinity/ci-tools/.github/workflows/check-pr-title.yaml@main
54 changes: 25 additions & 29 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Release PR
name: create_release_pr

on: workflow_dispatch

Expand All @@ -8,17 +8,25 @@ env:

jobs:
bump_version:
name: Bump version
name: bump_version
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 Python
uses: dfinity/ci-tools/actions/setup-python@main

- uses: ./.github/actions/setup-dfx
- name: Setup Commitizen
uses: dfinity/ci-tools/actions/setup-commitizen@main

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

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

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
Expand All @@ -28,19 +36,15 @@ 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: Bump Version
id: cz
uses: commitizen-tools/commitizen-action@master
with:
commit: false
push: false
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version
id: bump_version
uses: dfinity/ci-tools/actions/bump-version@main

- name: Print Version
run: echo "Bumping to version ${{ steps.cz.outputs.version }}"
run: echo "Bumping to version ${{ steps.bump_version.outputs.version }}"

- name: Generate canister declarations
run: dfx generate
Expand All @@ -51,22 +55,14 @@ jobs:
pnpm build
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: dfinity/ci-tools/actions/create-pr@main
with:
title: 'chore: release ${{ steps.cz.outputs.version }}'
body: |
branch_name: 'release/${{ steps.bump_version.outputs.version }}'
pull_request_title: 'chore: release ${{ steps.bump_version.outputs.version }}'
pull_request_body: |
After merging this PR, tag the merge commit with:
```shell
git tag ${{ steps.cz.outputs.version }}
git push origin ${{ steps.cz.outputs.version }}
git tag ${{ steps.bump_version.outputs.version }}
git push origin ${{ steps.bump_version.outputs.version }}
```
commit-message: 'chore: release ${{ steps.cz.outputs.version }}'
branch: 'release/${{ steps.cz.outputs.version }}'
add-paths: |
.cz.yaml
CHANGELOG.md
Cargo.toml
Cargo.lock
packages/certificate-verification-js/package.json
packages/ic-certification-testing-wasm/package.json
packages/ic-response-verification-wasm/package.json
commit_message: 'chore: release ${{ steps.bump_version.outputs.version }}'
13 changes: 6 additions & 7 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
name: e2e Tests
name: e2e_tests

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
SCCACHE_GHA_ENABLED: 'true'
RUSTC_WRAPPER: 'sccache'

jobs:
e2e_tests:
name: e2e Tests
name: e2e_tests:required
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/sccache-action@v0.0.3
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
14 changes: 14 additions & 0 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: generate_changelog

on:
push:
branches:
- main

jobs:
generate_changelog:
uses: dfinity/ci-tools/.github/workflows/generate-changelog.yaml@main
with:
auto_merge: true
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
21 changes: 13 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: release

on:
push:
Expand All @@ -11,17 +11,25 @@ env:

jobs:
release:
name: Release
name: release
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 Python
uses: dfinity/ci-tools/actions/setup-python@main

- uses: ./.github/actions/setup-dfx
- name: Setup Commitizen
uses: dfinity/ci-tools/actions/setup-commitizen@main

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

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

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
Expand All @@ -34,9 +42,6 @@ jobs:
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Setup Commitizen
run: pip install commitizen==2.42.1

- name: Generate canister declarations
run: dfx generate

Expand Down
Loading

0 comments on commit d53a44e

Please sign in to comment.