-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Run CI on merge commit instead of head commit (#22)
- Loading branch information
1 parent
a164e5c
commit 9f4a169
Showing
3 changed files
with
219 additions
and
88 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 |
---|---|---|
|
@@ -16,7 +16,7 @@ env: | |
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
outputs: | ||
changes-target-branch: ${{ steps.changes.outputs.changes-target-branch }} | ||
changes-base-git-rev: ${{ steps.changes.outputs.changes-base-git-rev }} | ||
|
@@ -67,7 +67,7 @@ jobs: | |
pattern: 'docker/ci\|scripts/dev_setup.sh' | ||
|
||
dev-setup-sh-test: | ||
runs-on: ubuntu-20.04-xl | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
needs: prepare | ||
if: ${{ needs.prepare.outputs.test-dev-setup == 'true' }} | ||
|
@@ -77,7 +77,7 @@ jobs: | |
target_os: [github] | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: build image with dev-setup.sh | ||
run: docker build -f docker/ci/${{ matrix.target_os }}/Dockerfile -t diem/build_environment:test . | ||
|
@@ -88,7 +88,7 @@ jobs: | |
github-token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
lint: | ||
runs-on: ubuntu-20.04-xl | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
needs: prepare | ||
if: ${{ needs.prepare.outputs.any-changes-founds == 'true' }} | ||
|
@@ -98,8 +98,6 @@ jobs: | |
- "${{github.workspace}}:/opt/git/diem" | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: ./.github/actions/build-setup | ||
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | ||
with: | ||
|
@@ -118,7 +116,7 @@ jobs: | |
github-token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
unit-test: | ||
runs-on: ubuntu-20.04-xl | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
needs: prepare | ||
if: ${{ needs.prepare.outputs.test-rust == 'true' }} | ||
|
@@ -128,9 +126,6 @@ jobs: | |
- "${{github.workspace}}:/opt/git/diem" | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 #get all the history!!! | ||
- uses: ./.github/actions/build-setup | ||
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | ||
with: | ||
|
@@ -163,7 +158,7 @@ jobs: | |
github-token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
hardhat-tests: | ||
runs-on: ubuntu-20.04-xl | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
needs: prepare | ||
if: ${{ needs.prepare.outputs.test-rust == 'true' }} | ||
|
@@ -173,8 +168,6 @@ jobs: | |
- "${{github.workspace}}:/opt/git/diem" | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: ./.github/actions/build-setup | ||
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | ||
- name: compile and install move-cli | ||
|
@@ -200,84 +193,78 @@ jobs: | |
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
# Compile (but don't run) the benchmarks, to insulate against bit rot | ||
build-benchmarks: | ||
runs-on: ubuntu-20.04-xl | ||
timeout-minutes: 30 | ||
needs: prepare | ||
if: ${{ needs.prepare.outputs.test-rust == 'true' }} | ||
container: | ||
image: ghcr.io/diem/diem_build_environment:${{ needs.prepare.outputs.changes-target-branch }} | ||
volumes: | ||
- "${{github.workspace}}:/opt/git/diem" | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: ./.github/actions/build-setup | ||
- uses: actions/[email protected] | ||
with: | ||
path: "/opt/cargo/git\n/opt/cargo/registry\n/opt/cargo/.package-cache" | ||
key: crates-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: "crates-${{ runner.os }}" | ||
- name: build benchmarks | ||
run: cargo x bench --no-run | ||
- uses: ./.github/actions/build-teardown | ||
- name: Early terminate workflow | ||
if: ${{ failure() }} | ||
uses: ./.github/actions/early-terminator | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
# # Compile (but don't run) the benchmarks, to insulate against bit rot | ||
# build-benchmarks: | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 30 | ||
# needs: prepare | ||
# if: ${{ needs.prepare.outputs.test-rust == 'true' }} | ||
# container: | ||
# image: ghcr.io/diem/diem_build_environment:${{ needs.prepare.outputs.changes-target-branch }} | ||
# volumes: | ||
# - "${{github.workspace}}:/opt/git/diem" | ||
# steps: | ||
# - uses: actions/[email protected] | ||
# - uses: ./.github/actions/build-setup | ||
# - uses: actions/[email protected] | ||
# with: | ||
# path: "/opt/cargo/git\n/opt/cargo/registry\n/opt/cargo/.package-cache" | ||
# key: crates-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | ||
# restore-keys: "crates-${{ runner.os }}" | ||
# - name: build benchmarks | ||
# run: cargo x bench --no-run | ||
# - uses: ./.github/actions/build-teardown | ||
# - name: Early terminate workflow | ||
# if: ${{ failure() }} | ||
# uses: ./.github/actions/early-terminator | ||
# with: | ||
# github-token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
perf-benchmarks: | ||
name: run-perf-benchmarks | ||
runs-on: ubuntu-20.04-xl | ||
timeout-minutes: 30 | ||
needs: | ||
- prepare | ||
- build-benchmarks | ||
env: | ||
CRITERION_HOME: /tmp/benches | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/[email protected] | ||
with: | ||
path: "/opt/cargo/git\n/opt/cargo/registry\n/opt/cargo/.package-cache" | ||
key: crates-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: "crates-${{ runner.os }}" | ||
- name: Download the previous baseline | ||
continue-on-error: true | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: bench-baseline | ||
- name: Run performance benchamrks | ||
run: | | ||
# Replace this with a cargo x bench | ||
cargo bench --package language-benchmarks | ||
- name: Archive criterion results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: bench-baseline | ||
retention-days: 5 | ||
path: | | ||
/tmp/benches | ||
- name: Early terminate workflow | ||
if: ${{ failure() }} | ||
uses: ./.github/actions/early-terminator | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
# perf-benchmarks: | ||
# name: run-perf-benchmarks | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 30 | ||
# needs: | ||
# - prepare | ||
# - build-benchmarks | ||
# env: | ||
# CRITERION_HOME: /tmp/benches | ||
# steps: | ||
# - uses: actions/[email protected] | ||
# - uses: actions/[email protected] | ||
# with: | ||
# path: "/opt/cargo/git\n/opt/cargo/registry\n/opt/cargo/.package-cache" | ||
# key: crates-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | ||
# restore-keys: "crates-${{ runner.os }}" | ||
# - name: Download the previous baseline | ||
# continue-on-error: true | ||
# uses: actions/download-artifact@v2 | ||
# with: | ||
# name: bench-baseline | ||
# - name: Run performance benchamrks | ||
# run: | | ||
# # Replace this with a cargo x bench | ||
# cargo bench --package language-benchmarks | ||
# - name: Archive criterion results | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: bench-baseline | ||
# retention-days: 5 | ||
# path: | | ||
# /tmp/benches | ||
# - name: Early terminate workflow | ||
# if: ${{ failure() }} | ||
# uses: ./.github/actions/early-terminator | ||
# with: | ||
# github-token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
build-move-analyzer-vscode-extension: | ||
name: Build VS Code extension for move-analyzer | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
needs: | ||
- prepare | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Use Node.js 14 | ||
uses: actions/[email protected] | ||
with: | ||
|
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
Oops, something went wrong.