From 68b7e8ce72280089f29a060ad03ba0258eb2f9ba Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 14 Jul 2023 14:39:06 +0100 Subject: [PATCH 1/3] Add CI to check the nix development environment builds successfully --- .github/workflows/development-environment.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/development-environment.yml diff --git a/.github/workflows/development-environment.yml b/.github/workflows/development-environment.yml new file mode 100644 index 0000000000..b83522f95f --- /dev/null +++ b/.github/workflows/development-environment.yml @@ -0,0 +1,13 @@ +name: "Build the nix development environment" +on: + pull_request: + push: +jobs: + build_dev_env: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # v22 + with: + nix_path: nixpkgs=channel:nixos-unstable + - run: nix develop --impure \ No newline at end of file From 066f3084b62b01c96ac36efceb5ebbf3bf1e466f Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 14 Jul 2023 14:56:28 +0100 Subject: [PATCH 2/3] Run unit tests, sytest and complement tests --- .github/workflows/development-environment.yml | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/development-environment.yml b/.github/workflows/development-environment.yml index b83522f95f..8dd2c48baa 100644 --- a/.github/workflows/development-environment.yml +++ b/.github/workflows/development-environment.yml @@ -1,13 +1,39 @@ -name: "Build the nix development environment" +name: "Build the nix development environment and run tests" on: + # TODO: Only run nightly pull_request: - push: jobs: - build_dev_env: + nix_dev_env_tests: runs-on: ubuntu-latest + strategy: + matrix: + test: ["unit", "sytest", "complement"] steps: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # v22 with: nix_path: nixpkgs=channel:nixos-unstable - - run: nix develop --impure \ No newline at end of file + + # Start the development environment. + - run: nix develop --impure + + # Sanity check we can import/run Synapse. + - run: python -m synapse.app.homeserver --help + + # Run the unit tests. + - if: ${{ matrix.unit }} + run: python -m twisted.trial -j6 tests + + # Run SyTest test suite. + - if: ${{ matrix.sytest }} + uses: actions/checkout@v3 + with: + repository: 'matrix-org/sytest' + path: './sytest' + + - if: ${{ matrix.sytest }} + run: ./sytest/run-tests.pl --test-blacklist-file sytest-blacklist + + # Run Complement test suite + - if: ${{ matrix.complement }} + run: ./scripts-dev/complement.sh From a38a51f48098300fc5c8f3b3afbd91948da04155 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 14 Jul 2023 15:05:41 +0100 Subject: [PATCH 3/3] check the output of env --- .github/workflows/development-environment.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/development-environment.yml b/.github/workflows/development-environment.yml index 8dd2c48baa..d6599d91e7 100644 --- a/.github/workflows/development-environment.yml +++ b/.github/workflows/development-environment.yml @@ -17,6 +17,8 @@ jobs: # Start the development environment. - run: nix develop --impure + - run: env + # Sanity check we can import/run Synapse. - run: python -m synapse.app.homeserver --help