diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml new file mode 100644 index 000000000..f5497bd73 --- /dev/null +++ b/.github/workflows/sims.yml @@ -0,0 +1,108 @@ +name: Sims +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !contains(github.ref, 'tags/')}} + +jobs: + test-sim-nondeterminism: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + + - name: Setup Go ๐Ÿงฐ + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Compute diff ๐Ÿ“œ + uses: technote-space/get-diff-action@v6.1.2 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + + - name: Save cache ๐Ÿ’พ + uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + + - name: Run nondeterminism simulation ๐Ÿงช + run: | + make test-sim-nondeterminism + if: env.GIT_DIFF + + test-sim-multi-seed-short: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + + - name: Setup Go ๐Ÿงฐ + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Compute diff ๐Ÿ“œ + uses: technote-space/get-diff-action@v6.1.2 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + + - name: Save cache ๐Ÿ’พ + uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + + - name: Run multi-seed-short simulation ๐Ÿงช + run: | + make test-sim-multi-seed-short + if: env.GIT_DIFF + + test-sim-import-export: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + + - name: Setup Go ๐Ÿงฐ + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Compute diff ๐Ÿ“œ + uses: technote-space/get-diff-action@v6.1.2 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + + - name: Save cache ๐Ÿ’พ + uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + + - name: Run import-export simulation ๐Ÿงช + run: | + make test-sim-import-export + if: env.GIT_DIFF