Skip to content

add test

add test #171

Workflow file for this run

name: integration tests
on:
pull_request:
push:
branches:
- main
- release/**
tags:
- "*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
integration_tests:
runs-on: ubuntu-latest
timeout-minutes: 240
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: changed-files
uses: tj-actions/changed-files@v34
with:
files: |
docs
*.md
**/*.md
- uses: cachix/install-nix-action@v22
with:
# pin to nix-2.13 to workaround compability issue of 2.14,
# see: https://github.com/cachix/install-nix-action/issues/161
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
if: steps.changed-files.outputs.only_changed == 'false'
- uses: cachix/cachix-action@v12
if: steps.changed-files.outputs.only_changed == 'false'
with:
name: cronos
extraPullNames: dapp
# github don't pass secrets for pull request from fork repos,
# in that case the push is disabled naturally.
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: Run integration tests
if: steps.changed-files.outputs.only_changed == 'false'
run: make run-integration-tests
- name: 'Tar debug files'
if: failure()
run: tar cfz debug_files.tar.gz -C "${TMPDIR-/tmp}/pytest-of-runner" .
- uses: actions/upload-artifact@v3
if: failure()
with:
name: debug-files
path: debug_files.tar.gz
if-no-files-found: ignore
upload-cache:
if: github.event_name == 'push'
needs: ["integration_tests"]
strategy:
matrix:
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: changed-files
uses: tj-actions/changed-files@v34
with:
files: |
docs
*.md
**/*.md
- uses: cachix/install-nix-action@v22
with:
# pin to nix-2.13 to workaround compability issue of 2.14,
# see: https://github.com/cachix/install-nix-action/issues/161
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
if: steps.changed-files.outputs.only_changed == 'false'
- uses: cachix/cachix-action@v12
if: steps.changed-files.outputs.only_changed == 'false'
with:
name: cronos
extraPullNames: dapp
# github don't pass secrets for pull request from fork repos,
# in that case the push is disabled naturally.
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: 'instantiate integration test env'
if: steps.changed-files.outputs.only_changed == 'false'
run: nix-store -r $(nix-instantiate integration_tests/shell.nix)