From e8eb4963d5b00af5cc208bef293081ed7baacd3c Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 24 Jul 2021 18:53:52 +0000 Subject: [PATCH 1/6] Simplify the workflow file This uses a matrix configuration to set up all the various configurations we're testing tracks with. It also adds testing on ruby 3.0 and testing postgres with all the various ruby versions. --- .github/workflows/continuous-integration.yml | 37 ++++---------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4ceda594..4775c47e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,38 +1,13 @@ --- name: Automated tests - on: pull_request - jobs: - test25mysql: + build: runs-on: ubuntu-latest + strategy: matrix + matrix: + ruby: ["2.5", "2.6", "2.7", "3.0"] + db: [sqlite, mysql, postgres] steps: - uses: actions/checkout@v1 - - run: bash -x script/cibuild 2.5 mysql - - test26mysql: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: bash -x script/cibuild 2.6 mysql - - test27mysql: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: bash -x script/cibuild 2.7 mysql - - test27postgres: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: bash -x script/cibuild 2.7 postgres - - test27sqlite: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: bash -x script/cibuild 2.7 sqlite - -# - run: bash -x script/cibuild 2.5 postgres -# - run: bash -x script/cibuild 2.7 postgres + - run: bash -x script/cibuild ${{ matrix.ruby }} ${{ matrix.db }} \ No newline at end of file From 9dd0ee6cefe9fcad92722330129218a46b2421ea Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 24 Jul 2021 18:57:48 +0000 Subject: [PATCH 2/6] Fix the syntax errors. --- .github/workflows/continuous-integration.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4775c47e..9db822b2 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -4,10 +4,10 @@ on: pull_request jobs: build: runs-on: ubuntu-latest - strategy: matrix - matrix: - ruby: ["2.5", "2.6", "2.7", "3.0"] - db: [sqlite, mysql, postgres] + strategy: + matrix: + ruby: ["2.5", "2.6", "2.7", "3.0"] + db: [sqlite, mysql, postgres] steps: - uses: actions/checkout@v1 - run: bash -x script/cibuild ${{ matrix.ruby }} ${{ matrix.db }} \ No newline at end of file From 2d20c8b40ec4883efa79b9caf01410f65b97337f Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 24 Jul 2021 19:02:15 +0000 Subject: [PATCH 3/6] Only define matrices for valid test environments Removes ruby 3.0 completely and ignores sqlite and postgres for the older Ruby versions --- .github/workflows/continuous-integration.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9db822b2..7e08a26d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -6,8 +6,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ["2.5", "2.6", "2.7", "3.0"] + ruby: ["2.5", "2.6", "2.7"] db: [sqlite, mysql, postgres] + exclude: + - ruby: "2.5" + db: [sqlite, postgres] + - ruby: "2.6" + db: [sqlite, postgres] + steps: - uses: actions/checkout@v1 - run: bash -x script/cibuild ${{ matrix.ruby }} ${{ matrix.db }} \ No newline at end of file From 076208f8041401ce16d16372f75939337338a41c Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 24 Jul 2021 19:04:48 +0000 Subject: [PATCH 4/6] Be more explicit about exclusions It would seem that lists are not available for use in exclusions. If this doesn't work, then I'll switch to inclusions only. --- .github/workflows/continuous-integration.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7e08a26d..a753fd91 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -10,9 +10,13 @@ jobs: db: [sqlite, mysql, postgres] exclude: - ruby: "2.5" - db: [sqlite, postgres] + db: sqlite + - ruby: "2.5" + db: postgres - ruby: "2.6" - db: [sqlite, postgres] + db: sqlite + - ruby: "2.6" + db: postgres steps: - uses: actions/checkout@v1 From af32031002df5bc15e1a7e6c25f84c94c14cd58f Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 24 Jul 2021 15:14:47 -0500 Subject: [PATCH 5/6] Fix due dates in recurring todo test --- test/models/recurring_todo_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/models/recurring_todo_test.rb b/test/models/recurring_todo_test.rb index 3e13da8b..e6535f14 100644 --- a/test/models/recurring_todo_test.rb +++ b/test/models/recurring_todo_test.rb @@ -156,10 +156,10 @@ class RecurringTodoTest < ActiveSupport::TestCase ## Test: every year # start from after june 8th 2008 - @yearly.start_from = Time.zone.local(2020,6,12) - assert_equal Time.zone.local(2021,6,8), @yearly.get_due_date(nil) # jun 8th next year - assert_equal Time.zone.local(2021,6,8), @yearly.get_due_date(Time.zone.local(2019,6,1)) # also next year - assert_equal Time.zone.local(2021,6,8), @yearly.get_due_date(Time.zone.local(2020,6,15)) # also next year + @yearly.start_from = Time.zone.local(2021,6,12) + assert_equal Time.zone.local(2022,6,8), @yearly.get_due_date(nil) # jun 8th next year + assert_equal Time.zone.local(2022,6,8), @yearly.get_due_date(Time.zone.local(2019,6,1)) # also next year + assert_equal Time.zone.local(2022,6,8), @yearly.get_due_date(Time.zone.local(2020,6,15)) # also next year this_year = Time.zone.now.utc.year @yearly.start_from = Time.zone.local(this_year+1,6,12) From b9a44c993fe77479598fcc42dcc038ecaa2b4125 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sun, 8 Aug 2021 20:44:54 -0500 Subject: [PATCH 6/6] re-add newline at end of file --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a753fd91..33de64c0 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -20,4 +20,4 @@ jobs: steps: - uses: actions/checkout@v1 - - run: bash -x script/cibuild ${{ matrix.ruby }} ${{ matrix.db }} \ No newline at end of file + - run: bash -x script/cibuild ${{ matrix.ruby }} ${{ matrix.db }}