Skip to content

chore: use dfinity/setup-dfx github action #2856

chore: use dfinity/setup-dfx github action

chore: use dfinity/setup-dfx github action #2856

name: motoko-quicksort
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
sources: ${{ steps.filter.outputs.sources }}
steps:
- uses: actions/checkout@v4
if: github.event_name == 'push'
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
sources:
- motoko/quicksort/**
- .github/workflows/provision-darwin.sh
- .github/workflows/provision-linux.sh
- .github/workflows/motoko-quicksort-example.yaml
motoko-quicksort-example-darwin:
needs: changes
if: github.event_name == 'push' || needs.changes.outputs.sources == 'true'
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- uses: dfinity/setup-dfx@main
- name: Provision Darwin
run: bash .github/workflows/provision-darwin.sh
- name: Motoko Quicksort Darwin
run: |
dfx start --background
pushd motoko/quicksort
make test
popd
motoko-quicksort-example-linux:
needs: changes
if: github.event_name == 'push' || needs.changes.outputs.sources == 'true'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dfinity/setup-dfx@main
- name: Provision Linux
run: bash .github/workflows/provision-linux.sh
- name: Motoko Quicksort Linux
run: |
dfx start --background
pushd motoko/quicksort
make test
popd