Skip to content

Commit

Permalink
chore: standardises ci workflows (#98)
Browse files Browse the repository at this point in the history
Moves linting to workflows that target a pull request or a push to the
develop branch.
  • Loading branch information
jkongie authored Nov 19, 2024
1 parent 2a48185 commit 9b0dd5a
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 696 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/lint.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/pull-request-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: pull-request-main

on:
merge_group:
pull_request:
branches:
- main
- develop # TODO - Remove when develop branch is replaced by main

jobs:
ci-lint:
name: Lint
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Linting Go
uses: smartcontractkit/.github/actions/ci-lint-go@7a4d99cb349ea8f25195d2390d157942031f8a57
with:
golangci-lint-version: v1.57.2

ci-lint-misc:
name: Lint Misc
runs-on: ubuntu-latest
steps:
- name: Linting Go Misc
uses: smartcontractkit/.github/actions/ci-lint-misc@7a4d99cb349ea8f25195d2390d157942031f8a57

ci-test:
name: Tests
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
env:
TEST_NODE_URL: '${{ secrets.TEST_NODE_URL }}'
TEST_TIMELOCK_ADDRESS: '${{ secrets.TEST_TIMELOCK_ADDRESS }}'
TEST_PROXY_ADDRESS: '${{ secrets.TEST_PROXY_ADDRESS }}'
TEST_PRIVATE_KEY: '${{ secrets.TEST_PRIVATE_KEY }}'
steps:
- name: Build and test
uses: smartcontractkit/.github/actions/ci-test-go@7a4d99cb349ea8f25195d2390d157942031f8a57
with:
go-test-cmd: go test -short -coverprofile=coverage.out -covermode=atomic -race ./...
use-go-cache: true
28 changes: 28 additions & 0 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: push-main

on:
push:
branches:
- main
- develop # TODO - Remove when develop branch is replaced by main

jobs:
ci-lint:
name: Lint
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Linting Go
uses: smartcontractkit/.github/actions/ci-lint-go@7a4d99cb349ea8f25195d2390d157942031f8a57
with:
golangci-lint-version: v1.57.2

ci-lint-misc:
name: Lint Misc
runs-on: ubuntu-latest
steps:
- name: Linting Go Misc
uses: smartcontractkit/.github/actions/ci-lint-misc@7a4d99cb349ea8f25195d2390d157942031f8a57
32 changes: 0 additions & 32 deletions .github/workflows/test.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ MacOSX*
report.html
timelock-worker.log

# Test & linter reports
*report.xml
*report.json
*.out
*coverage*
testdata/

# Test binary, built with `go test -c`
*.test

Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang 1.22
golang 1.22.9
golangci-lint 1.57.2
Loading

0 comments on commit 9b0dd5a

Please sign in to comment.