Skip to content

Commit

Permalink
temp: run stripped windows-only workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg committed Jun 21, 2022
1 parent 917d0f4 commit 029e3ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 329 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ jobs:
job:
# The OS is used for the runner
# The target is used by Cargo
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc

Expand Down
119 changes: 1 addition & 118 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
workflow_call:

env:
IS_NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
Expand Down Expand Up @@ -38,34 +39,6 @@ jobs:
echo "::set-output name=release_name::${GITHUB_REF_NAME}"
fi
# Creates a `nightly-SHA` tag for this specific nightly
# This tag is used for this specific nightly version's release
# which allows users to roll back. It is also used to build
# the changelog.
- name: Create build-specific nightly tag
if: ${{ env.IS_NIGHTLY }}
uses: actions/github-script@v5
env:
TAG_NAME: ${{ steps.release_info.outputs.tag_name }}
with:
script: |
const createTag = require('./.github/scripts/create-tag.js')
await createTag({ github, context }, process.env.TAG_NAME)
- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v2
with:
configuration: "./.github/changelog.json"
fromTag: ${{ env.IS_NIGHTLY && 'nightly' || '' }}
toTag: ${{ steps.release_info.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-docker:
name: Release Docker
uses: ./.github/workflows/docker-publish.yml

release:
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
Expand All @@ -78,26 +51,6 @@ jobs:
# The target is used by Cargo
# The arch is either 386, arm64 or amd64
# The svm target platform to use for the binary https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
- os: ubuntu-latest
platform: linux
target: x86_64-unknown-linux-gnu
arch: amd64
svm_target_platform: linux-amd64
- os: ubuntu-latest
platform: linux
target: aarch64-unknown-linux-gnu
arch: arm64
svm_target_platform: linux-aarch64
- os: macos-latest
platform: darwin
target: x86_64-apple-darwin
arch: amd64
svm_target_platform: macosx-amd64
- os: macos-latest
platform: darwin
target: aarch64-apple-darwin
arch: arm64
svm_target_platform: macosx-aarch64
- os: windows-latest
platform: win32
target: x86_64-pc-windows-msvc
Expand Down Expand Up @@ -164,73 +117,3 @@ jobs:
echo "::set-output name=file_name::foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip"
fi
shell: bash

- name: Build man page
id: man
if: ${{ matrix.job.target == 'x86_64-unknown-linux-gnu' }}
env:
PLATFORM_NAME: ${{ matrix.job.platform }}
TARGET: ${{ matrix.job.target }}
VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
run: |
sudo apt-get -y install help2man
help2man -N ./target/${TARGET}/release/forge > forge.1
help2man -N ./target/${TARGET}/release/cast > cast.1
help2man -N ./target/${TARGET}/release/anvil > anvil.1
gzip forge.1
gzip cast.1
gzip anvil.1
tar -czvf "foundry_man_${VERSION_NAME}.tar.gz" forge.1.gz cast.1.gz anvil.1.gz
echo "::set-output name=foundry_man::foundry_man_${VERSION_NAME}.tar.gz"
shell: bash

# Creates the release for this specific version
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.prepare.outputs.release_name }}
tag_name: ${{ needs.prepare.outputs.tag_name }}
prerelease: ${{ env.IS_NIGHTLY }}
body: ${{ needs.prepare.outputs.changelog }}
files: |
${{ steps.artifacts.outputs.file_name }}
${{ steps.man.outputs.foundry_man }}
# If this is a nightly release, it also updates the release
# tagged `nightly` for compatability with `foundryup`
- name: Update nightly release
if: ${{ env.IS_NIGHTLY }}
uses: softprops/action-gh-release@v1
with:
name: 'Nightly'
tag_name: 'nightly'
prerelease: true
body: ${{ needs.prepare.outputs.changelog }}
files: |
${{ steps.artifacts.outputs.file_name }}
${{ steps.man.outputs.foundry_man }}
cleanup:
name: Release cleanup
runs-on: ubuntu-latest
needs: release

steps:
- name: Checkout sources
uses: actions/checkout@v2

# Moves the `nightly` tag to `HEAD`
- name: Move nightly tag
if: ${{ env.IS_NIGHTLY }}
uses: actions/github-script@v5
with:
script: |
const moveTag = require('./.github/scripts/move-tag.js')
await moveTag({ github, context }, 'nightly')
- name: Delete old nightlies
uses: actions/github-script@v5
with:
script: |
const prunePrereleases = require('./.github/scripts/prune-prereleases.js')
await prunePrereleases({github, context})
206 changes: 3 additions & 203 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,210 +7,10 @@ on:
name: test

jobs:
unit:
name: unit tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true

- name: cargo test
run: cargo test --locked --workspace --all-features --lib --bins -- --skip fork

fork-unit:
name: fork unit tests
runs-on: ubuntu-latest
env:
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: Forge RPC cache
uses: actions/cache@v3
with:
path: "$HOME/.foundry/cache"
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }}

- name: cargo test
run: cargo test --locked --workspace --all-features --lib --bins fork

integration:
name: integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
# required for forge commands that use git
- name: setup git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: cargo test
run: cargo test --locked --workspace -- --skip fork

fork-integration:
name: fork integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: Forge RPC cache
uses: actions/cache@v3
with:
path: "$HOME/.foundry/cache"
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }}

- name: cargo test
run: cargo test --locked --workspace -- fork

external-integration:
name: external integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true

- name: Force use of HTTPS for submodules
run: git config --global url."https://github.com/".insteadOf "git@github.com:"

- name: cargo test
run: cargo test --locked -p foundry-cli --features external-integration-tests -- --skip fork

external-fork-integration:
name: external fork integration tests
runs-on: ubuntu-latest
env:
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: Forge RPC cache
uses: actions/cache@v3
with:
path: "$HOME/.foundry/cache"
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }}

- name: Force use of HTTPS for submodules
run: git config --global url."https://github.com/".insteadOf "git@github.com:"

- name: cargo test
run: cargo test --locked -p foundry-cli --features external-integration-tests fork_integration

doc:
name: doc tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true

- name: cargo test
run: cargo test --locked --workspace --all-features --doc

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt, clippy
override: true

- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true

- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check

- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
args: --all --all-features -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}

cross-platform:
name: Cross-platform tests
if: github.event_name != 'pull_request'
needs: [ integration, lint, doc, unit ]
uses: ./.github/workflows/cross-platform.yml

temp-release:
name: Test Windows releases
uses: ./.github/workflows/release.yml

0 comments on commit 029e3ba

Please sign in to comment.