Skip to content

Commit

Permalink
test: remove vendored actions (#441)
Browse files Browse the repository at this point in the history
* use original action instead of dfinity fork

* regex based conventional pr title

* bats submodules

* use bats from submodule in examples.yml

* try fix

* checkout submodules only in test
  • Loading branch information
lwshang authored Nov 1, 2023
1 parent 38be74d commit 0b201e9
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
schedule:
- cron: '0 4 * * 0,3' # 4 a.m. UTC every Sun and Wed, keep actions-cache available
- cron: "0 4 * * 0,3" # 4 a.m. UTC every Sun and Wed, keep actions-cache available

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,24 @@ concurrency:

jobs:
check:
name: conventional-pr-title:required
runs-on: ubuntu-latest
steps:
- uses: dfinity/conventional-pr-title-action@v2.2.3
with:
success-state: Title follows the specification.
failure-state: Title does not follow the specification.
context-name: conventional-pr-title
preset: conventional-changelog-angular@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Conventional commit patterns:
# verb: description
# verb!: description of breaking change
# verb(scope): Description of change to $scope
# verb(scope)!: Description of breaking change to $scope
# verb: feat, fix, ...
# scope: refers to the part of code being changed. E.g. " (accounts)" or " (accounts,canisters)"
# !: Indicates that the PR contains a breaking change.
- env:
TITLE: ${{ github.event.pull_request.title }}
run: |
echo "PR title: $TITLE"
if [[ "$TITLE" =~ ^(feat|fix|chore|build|ci|docs|style|refactor|perf|test)(\([-a-zA-Z0-9,]+\))?\!?\: ]]; then
echo pass
else
echo "PR title does not match conventions"
exit 1
fi
15 changes: 6 additions & 9 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
schedule:
- cron: '0 4 * * 0,3' # 4 a.m. UTC every Sun and Wed, keep actions-cache available
- cron: "0 4 * * 0,3" # 4 a.m. UTC every Sun and Wed, keep actions-cache available

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -57,6 +57,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Cache
uses: actions/cache@v3
Expand Down Expand Up @@ -90,14 +92,9 @@ jobs:
mv candid-extractor /usr/local/bin/candid-extractor
- name: Install DFX
uses: dfinity/setup-dfx@main
with:
dfx-version: "${{ env.dfx-version }}"

- name: Setup BATS
uses: mig4/setup-bats@v1.0.2
uses: dfinity/setup-dfx@main
with:
bats-version: 1.2.1
dfx-version: "${{ env.dfx-version }}"

- name: Install bitcoin
if: ${{ matrix.project-name == 'management_canister' }}
Expand All @@ -117,7 +114,7 @@ jobs:
- name: Run Tests
shell: bash
run: |
bats -r examples/${{ matrix.project-name }}
./examples/bats/bats-core/bin/bats -r examples/${{ matrix.project-name }}
env:
RUST_BACKTRACE: 1

Expand Down
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "examples/bats/bats-core"]
path = examples/bats/bats-core
url = https://github.com/bats-core/bats-core.git
[submodule "examples/bats/bats-support"]
path = examples/bats/bats-support
url = https://github.com/bats-core/bats-support.git
[submodule "examples/bats/bats-assert"]
path = examples/bats/bats-assert
url = https://github.com/bats-core/bats-assert.git
1 change: 1 addition & 0 deletions examples/bats/bats-assert
Submodule bats-assert added at e2d855
1 change: 1 addition & 0 deletions examples/bats/bats-core
Submodule bats-core added at f1f511
1 change: 1 addition & 0 deletions examples/bats/bats-support
Submodule bats-support added at 9bf10e

0 comments on commit 0b201e9

Please sign in to comment.