-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Marek Kaput <[email protected]> Signed-off-by: maciektr <[email protected]>
- Loading branch information
Showing
2 changed files
with
59 additions
and
1 deletion.
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
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,56 @@ | ||
# Using Scarb in CI | ||
|
||
## Github Actions | ||
|
||
To use Scarb in your GitHub Actions workflow, you need to download the Scarb binary, unpack the archive, and add the | ||
directory containing Scarb binary to your PATH variable. | ||
You can find examples of the Scarb setup in the following `.github/workflows/build.yml` file, for Linux, macOS, and Windows. | ||
|
||
```yaml copy | ||
name: Build Scarb project | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
SCARB_VERSION: v0.1.0 | ||
|
||
jobs: | ||
build: | ||
name: test ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- name: linux x86-64 | ||
os: ubuntu-latest | ||
- name: macos x86-64 | ||
os: macos-latest | ||
- name: windows x86-64 | ||
os: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Scarb for Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
wget https://github.com/software-mansion/scarb/releases/download/${{ env.SCARB_VERSION }}/scarb-${{ env.SCARB_VERSION }}-x86_64-unknown-linux-gnu.tar.gz | ||
tar -xvzf scarb-${{ env.SCARB_VERSION }}-x86_64-unknown-linux-gnu.tar.gz | ||
echo "$GITHUB_WORKSPACE/scarb-${{ env.SCARB_VERSION }}-x86_64-unknown-linux-gnu/bin" >> $GITHUB_PATH | ||
- name: Setup Scarb for OSX | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
wget https://github.com/software-mansion/scarb/releases/download/${{ env.SCARB_VERSION }}/scarb-${{ env.SCARB_VERSION }}-x86_64-apple-darwin.tar.gz | ||
tar -xvzf scarb-${{ env.SCARB_VERSION }}-x86_64-apple-darwin.tar.gz | ||
echo "$GITHUB_WORKSPACE/scarb-${{ env.SCARB_VERSION }}-x86_64-apple-darwin/bin" >> $GITHUB_PATH | ||
- name: Setup Scarb for Windows | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
C:\msys64\usr\bin\wget.exe https://github.com/software-mansion/scarb/releases/download/${{ env.SCARB_VERSION }}/scarb-${{ env.SCARB_VERSION }}-x86_64-pc-windows-msvc.zip | ||
7z x scarb-${{ env.SCARB_VERSION }}-x86_64-pc-windows-msvc.zip | ||
Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE/scarb-${{ env.SCARB_VERSION }}-x86_64-pc-windows-msvc/bin" | ||
- run: scarb build | ||
``` |