Skip to content

Update .github/workflows/mattermost.yml #231

Update .github/workflows/mattermost.yml

Update .github/workflows/mattermost.yml #231

Workflow file for this run

name: CI-playground
# This file is part of t8code.
# t8code is a C library to manage a collection (a forest) of multiple
# connected adaptive space-trees of general element types in parallel.
#
# Copyright (C) 2015 the developers
#
# t8code is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# t8code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with t8code; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# The purpose of this script is for debugging and testing
# the github CI without the need to trigger the whole workflow.
# Its contents may change arbitrarily.
on:
push:
branches:
- feature-*CI* # for testing this script, all feature branches with "CI" in their name
workflow_dispatch: # Be able to trigger this manually on github.com
jobs:
test_vars:
runs-on: ubuntu-20.04
container: dlramr/t8code-ubuntu:t8-dependencies
env:
SC_DEBUG: ../sc/build_debug
P4EST_DEBUG: ../p4est/build_debug
steps:
- name: Test vars
run: echo "[$SC_DEBUG] [$P4EST_DEBUG]"
- name: New envs
run: echo NEW_VAR=blub >> $GITHUB_ENV
- name: Test var
run: echo $NEW_VAR ${{ env.NEW_VAR }}
- name: Test var for if not set
run: echo IF_VAR= >> $GITHUB_ENV
- name: print if 0 or var set
if: ${{ 0 || env.IF_VAR }}
run: echo $IF_VAR
- name: print if var set
if: ${{ env.IF_VAR }}
run: echo $IF_VAR
- name: print if 0
if: 0
run: echo 0 is true
- name: print var
run: echo $IF_VAR
- name: Test var for if set
run: echo IF_VAR2=1 >> $GITHUB_ENV
- name: print if var set
if: ${{ env.IF_VAR2 }}
run: echo $IF_VAR2
- name: print if 0 or var set
if: ${{ 0 || env.IF_VAR2 }}
run: echo $IF_VAR2
- name: print if 0
if: 0
run: echo 0 is true
- name: print var
run: echo $IF_VAR2
test_cache:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: define sc var
run: hash=`git rev-parse HEAD:sc` && echo sc_commit=$hash >> $GITHUB_ENV
- name: define p4est var
run: hash=`git rev-parse HEAD:sc` && echo sc_commit=$hash >> $GITHUB_ENV
- name: Test var
run: echo $sc_commit $p4est_commit
# Cache sc
- name: create folder var
run: echo test_path=$PWD/test_path >> $GITHUB_ENV
- name: Cache SC
id: sc_cache
uses: actions/cache@v3
with:
path: |
sc/build_test
sc/build_test_ci/install
${{ env.test_path }}
# increase this number to trigger new caching
key: sc-3
- name: create build and write commit
if: steps.sc_cache.outputs.cache-hit != 'true'
run: mkdir sc/build_test
&& date >> sc/build_test/commit.log
&& echo $sc_commit >> sc/build_test/commit.log
&& mkdir sc/build_test_ci && mkdir sc/build_test_ci/install
&& date >> sc/build_test_ci/install/commit.log
&& mkdir test_path
&& date >> test_path/test.log
- name: print files
run: cat sc/build_test/commit.log
&& cat sc/build_test_ci/install/commit.log
&& cat test_path/test.log