Skip to content

Commit 3297094

Browse files
authored
fix workflows (#342)
* fix workflows * has to be called action.yml I guess * need to check out first, duh * add shell * make test runner beefier * further workflow improvements
1 parent db6e4e3 commit 3297094

File tree

5 files changed

+72
-35
lines changed

5 files changed

+72
-35
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Install"
2+
description: "Sets up Node.js and runs install"
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v3
9+
with:
10+
node-version: 16
11+
registry-url: "https://registry.npmjs.org"
12+
cache: "yarn"
13+
14+
- name: Install dependencies
15+
shell: bash
16+
run: yarn

.github/workflows/lint.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,32 @@ name: Solhint Lint
66
on:
77
# Triggers the workflow on push or pull request events but only for the main branch
88
push:
9-
branches: [ main ]
9+
branches: [main]
1010
pull_request:
11-
branches: [ main ]
11+
branches: [main]
12+
13+
# cancel previous runs if new commits are pushed to the branch
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
1217

1318
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1419
jobs:
1520
# This workflow contains a single job called "build"
16-
build:
21+
lint:
1722
# The type of runner that the job will run on
1823
runs-on: ubuntu-latest
1924

2025
# Steps represent a sequence of tasks that will be executed as part of the job
2126
steps:
22-
- uses: actions/checkout@v2
27+
- name: Checkout repository
28+
uses: actions/checkout@v3
2329
with:
2430
submodules: recursive
25-
- name: Setup Node.js environment
26-
uses: actions/[email protected]
27-
# Runs a single command using the runners shell
28-
- name: Run npm install
29-
run: yarn
30-
- name: Run lint
31+
fetch-depth: 25
32+
33+
- name: Setup Project
34+
uses: ./.github/composite-actions/setup
35+
36+
- name: Run Lint
3137
run: yarn lint

.github/workflows/prettier.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,31 @@ name: Prettier Formatting
66
on:
77
# Triggers the workflow on push or pull request events but only for the main branch
88
push:
9-
branches: [ main ]
9+
branches: [main]
1010
pull_request:
11-
branches: [ main ]
11+
branches: [main]
12+
13+
# cancel previous runs if new commits are pushed to the branch
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
1217

13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1418
jobs:
1519
# This workflow contains a single job called "build"
16-
build:
20+
lint:
1721
# The type of runner that the job will run on
1822
runs-on: ubuntu-latest
1923

2024
# Steps represent a sequence of tasks that will be executed as part of the job
2125
steps:
22-
- uses: actions/checkout@v2
26+
- name: Checkout repository
27+
uses: actions/checkout@v3
2328
with:
2429
submodules: recursive
25-
- name: Setup Node.js environment
26-
uses: actions/[email protected]
27-
# Runs a single command using the runners shell
28-
- name: Run npm install
29-
run: yarn
30-
- name: Run prettier:contracts
30+
fetch-depth: 25
31+
32+
- name: Setup Project
33+
uses: ./.github/composite-actions/setup
34+
35+
- name: Run Prettier
3136
run: yarn prettier:contracts

.github/workflows/slither.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
pull_request:
77
branches: [main]
88

9+
# cancel previous runs if new commits are pushed to the branch
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
914
jobs:
1015
analyze:
1116
runs-on: ubuntu-latest
@@ -14,15 +19,13 @@ jobs:
1419
security-events: write
1520
steps:
1621
- name: Checkout repository
17-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
1823
with:
1924
submodules: recursive
25+
fetch-depth: 25
2026

21-
- name: Setup Node.js environment
22-
uses: actions/[email protected]
23-
24-
- name: Run npm install
25-
run: yarn
27+
- name: Setup Project
28+
uses: ./.github/composite-actions/setup
2629

2730
- name: Install Foundry
2831
uses: onbjerg/foundry-toolchain@v1

.github/workflows/tests.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,30 @@ on:
1010
pull_request:
1111
branches: [main]
1212

13+
# cancel previous runs if new commits are pushed to the branch
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1318
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1419
jobs:
1520
# This workflow contains a single job called "build"
16-
build:
21+
test:
1722
# The type of runner that the job will run on
18-
runs-on: ubuntu-latest
23+
# 16 core paid runner
24+
runs-on: ubuntu-latest-16
1925

2026
# Steps represent a sequence of tasks that will be executed as part of the job
2127
steps:
22-
- uses: actions/checkout@v2
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
2330
with:
2431
submodules: recursive
25-
- name: Setup Node.js environment
26-
uses: actions/[email protected]
27-
# Runs a single command using the runners shell
28-
- name: Run npm install
29-
run: yarn
32+
fetch-depth: 25
33+
34+
- name: Setup Project
35+
uses: ./.github/composite-actions/setup
36+
3037
- name: Install Foundry
3138
uses: onbjerg/foundry-toolchain@v1
3239
with:

0 commit comments

Comments
 (0)