Skip to content

Commit

Permalink
Initial CI using GitHub actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzhyk committed Jun 15, 2021
1 parent 295a09f commit fab43fa
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push to any branch
push:
# Triggers the workflow on pull request events but only for the master branch
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

release:
types: [ published ]

defaults:
run:
shell: bash

jobs:
build_and_test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

env:
DDLOG_TEST_PROGRESS: 1
CLASSPATH: ${{ github.workspace }}/flatbuffers/java

steps:
- run: echo "Build triggered by GitHub event ${GITHUB_EVENT_NAME}"
- uses: actions/checkout@v2
# flatc gets installed to '${HOME}/.local/bin'.
- run: echo "${HOME}/.local/bin" >> "${GITHUB_PATH}"
- run: echo "${PATH}"
- run: export DIST_NAME=ddlog-${{ github.ref }}-$(date +'%Y%m%d%H%M%S')-${{ runner.os }}
- run: ./tools/install-flatbuf.sh
- run: stack --no-terminal test --ta '-p tutorial'
- run: stack --no-terminal install
- name: build distro
if: ${{ github.event_name == 'release' }}
run: ./build_distro.sh
- name: Upload Release Asset
if: ${{ github.event_name == 'release' }}
uses: alexellis/upload-assets@0.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: "./${{ env.DIST_NAME }}.tar.gz"

# Run build-distro.sh if the build was triggered by a 'release' event.
#build_distro:
# needs: build_and_test
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# if: ${{ github.event_name == 'release' }}
# steps:
# - run: export DIST_NAME=ddlog-${{ github.ref }}-$(date +'%Y%m%d%H%M%S')-${{ runner.os }}
# - run: ./build_distro.sh
6 changes: 4 additions & 2 deletions build_distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ mv Cargo.toml Cargo.toml.bak

cp Cargo.full.toml Cargo.toml

# Set relative path to vendor directory in `.cargo/config`
cargo vendor -s Cargo.toml > config.tmp
# Set relative path to vendor directory in `.cargo/config`.
# `cargo vendor` fails on the differential-dataflow crate when ${HOME} is a
# symlink.
HOME=$(readlink -f "${HOME}") cargo vendor -s Cargo.toml > config.tmp

# Restore `Cargo.toml`.
mv Cargo.toml.bak Cargo.toml
Expand Down

0 comments on commit fab43fa

Please sign in to comment.