-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ProjectOpenSea/dan/2023/10/test-ci
test ci
- Loading branch information
Showing
16 changed files
with
238 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Github Actions automatically updated formatting with forge fmt\n72f425f1c2be0f568f8da002e469c9808bf41759 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- | ||
Borrowed from foundry. | ||
Thank you for your Pull Request. Please provide a description above and review | ||
the requirements below. | ||
Bug fixes and new features should include tests. | ||
--> | ||
|
||
## Motivation | ||
|
||
<!-- | ||
Explain the context and why you're making that change. What is the problem | ||
you're trying to solve? In some cases there is not a problem and this can be | ||
thought of as being the motivation for your change. | ||
If your PR solves a particular issue, tag that issue. | ||
--> | ||
|
||
## Solution | ||
|
||
<!-- | ||
Summarize the solution and provide any necessary context needed to understand | ||
the code change. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Autofix Linting | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
# Down scope as necessary via https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token | ||
permissions: | ||
checks: write | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
run-linters: | ||
name: Run linters | ||
if: github.event.issue.pull_request && ${{ github.event.comment.body == '!fix' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: GetBranch | ||
id: 'get-branch' | ||
run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName') | ||
env: | ||
REPO: ${{ github.repository }} | ||
PR_NO: ${{ github.event.issue.number }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ steps.get-branch.outputs.branch }} | ||
|
||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Lint | ||
run: | | ||
forge fmt | ||
pwd | ||
if [[ `git diff --exit-code` ]]; then | ||
git config --local user.name 'GitHub Actions Bot' | ||
git config --local user.email '<>' | ||
git add . | ||
git commit -m "Github Actions automatically updated formatting with forge fmt" | ||
COMMIT_HASH=$(git rev-parse HEAD) | ||
echo "# Github Actions automatically updated formatting with forge fmt\n$COMMIT_HASH" >> .git-blame-ignore-revs | ||
git add .git-blame-ignore-revs | ||
git commit -m "Updated .git-blame-ignore-revs with commit $COMMIT_HASH" | ||
BRANCH_NAME=$(git symbolic-ref --short HEAD) | ||
git push origin $BRANCH_NAME | ||
fi | ||
id: update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Forge Linting | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
tags: ["*"] | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Lint | ||
run: | | ||
echo "Running forge fmt --check" | ||
if ! forge fmt --check; then | ||
echo "The linting check failed. You can fix it locally with `forge fmt` and then push, or you can have a GitHub action take care of it for you by commenting '!fix' on the PR." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,102 @@ | ||
name: test | ||
name: Seaport Test CI | ||
|
||
on: workflow_dispatch | ||
on: | ||
push: | ||
branches: [main, 1.*, 2.*] | ||
tags: ["*"] | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
forge: | ||
name: Run Forge Tests (via_ir = true; fuzz_runs = 5000) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
forge build --sizes | ||
id: build | ||
- name: Install forge dependencies | ||
run: forge install | ||
|
||
- name: Precompile reference using 0.8.13 and via-ir=false | ||
run: FOUNDRY_PROFILE=reference forge build | ||
|
||
- name: Precompile optimized using 0.8.17 and via-ir=true | ||
run: FOUNDRY_PROFILE=optimized forge build | ||
|
||
- name: Run tests | ||
run: FOUNDRY_PROFILE=test forge test -vvv | ||
|
||
- name: Run Forge tests | ||
- name: Lint | ||
run: | | ||
forge test -vvv | ||
id: test | ||
forge fmt | ||
pwd | ||
if [[ `git diff --exit-code` ]]; then | ||
git config --local user.name 'GitHub Actions Bot' | ||
git config --local user.email '<>' | ||
git add . | ||
git commit -m "Github Actions automatically updated formatting with forge fmt" | ||
COMMIT_HASH=$(git rev-parse HEAD) | ||
echo "# Github Actions automatically updated formatting with forge fmt\n$COMMIT_HASH" >> .git-blame-ignore-revs | ||
git add .git-blame-ignore-revs | ||
git commit -m "Updated .git-blame-ignore-revs with commit $COMMIT_HASH" | ||
BRANCH_NAME=$(git symbolic-ref --short HEAD) | ||
git push origin $BRANCH_NAME | ||
fi | ||
id: update | ||
|
||
forge-offerers: | ||
name: Run Contract Offerer Forge Tests (via_ir = false; fuzz_runs = 1000) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Install forge dependencies | ||
run: forge install | ||
|
||
- name: Run tests | ||
run: FOUNDRY_PROFILE=offerers forge test -vvv | ||
|
||
forge-coverage: | ||
name: Run Forge Coverage report on tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Install forge dependencies | ||
run: forge install | ||
|
||
- name: Run coverage with lcov output | ||
run: SEAPORT_COVERAGE=true forge coverage --report lcov | ||
|
||
- uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./lcov.info | ||
flags: foundry | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.